下面代码中的我的 While 循环不起作用。当我注释掉 while 行和两个括号时,while 循环内的所有内容都很好。一旦我取消注释while循环并再次运行它,我没有收到任何错误,但里面的所有回声都消失了。
case 'search':
echo "searching".$firstname;
$sqlsearch="SELECT * FROM Customer WHERE firstname='$firstname'";
$sim = mysql_query($conndb, $sqlsearch);
while($row = mysql_fetch_array($sim))
{
echo "firstname: ".$row['firstname']."<br>";
echo "lastname: ".$row['lastname']."<br>";
echo "phone: ".$row['phone']."<br>";
echo "address: ".$row['address']."<br>";
echo "city: ".$row['city']."<br>";
echo "state: ".$row['state']."<br>";
echo "zip: ".$row['zip']."<br>";
echo $sqlsearch;
}
echo "<br>";
echo "seaching 2";
break;