<?php
$soil_ph = $_POST['soilph'];
$query = "select ph_id,ph_name,ph_from,ph_to from tbl_soilph
where '$soil_ph' between ph_from and ph_to";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
if ($row == 0)
{
echo 'Invalid or out of range';
}
else
{
$ph = $row['ph_name'];
echo $row['ph_name'];
}
}
?>
---回声不起作用@($row = 0)---有人可以帮助我吗?上面的代码工作正常,它给出了结果,但是当没有数据时它不显示消息“无效输入”?