Saturday, December 1, 2018

mysql - php while loop + where


list table






  • id

  • name

  • illness

  • recipe

  • directions



    $illness = 'Highblood';
    $list = mysql_query("SELECT * FROM list ",$con);
    while($row=mysql_fetch_array($list, MYSQL_ASSOC)){
    $test[] = $row['recipe'];

    $test2[] = $row['directions'];
    }



I want to only get the rows




  • $row['recipe'];

  • $row['directions'];




if the value of illness column is equals to highblood.
how do I do this?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...