Saturday 1 December 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...