列表
方向
$illness = 'Highblood';
$list = mysql_query("SELECT * FROM list ",$con);
while($row=mysql_fetch_array($list, MYSQL_ASSOC)){
$test[] = $row['recipe'];
$test2[] = $row['directions'];
}
我想只获取行
如果疾病列的值等于highblood。 我该怎么做?
答案 0 :(得分:2)
如果您不能像这样做基本查询,我建议您在Google上进行一些搜索以学习MySQL。
mysql_query("SELECT * FROM list WHERE illness = '".$illness."'",$con);
答案 1 :(得分:2)
仅选择所需的行。
$list = mysql_query("SELECT recipe,directions FROM list WHERE illness='Highblood'",$con);
while($row=mysql_fetch_array($list, MYSQL_ASSOC)){
$test[] = $row['recipe'];
$test2[] = $row['directions'];
}