Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$result=mysql_query("SELECT * FROM $name WHERE date='$date'");
如何检查是否选择了任何内容。
我试过这些但没用: if($result == NULL ){} ,if(!$result){}
if($result == NULL ){}
if(!$result){}
帮助 !
您可以使用
mysql_num_rows ($result);
获取返回的行数
if(!$result)
只会告诉查询是否执行
您可以按以下方式计算记录数
$num_rows = mysql_num_rows($result); if($num_rows > 0) { //do something.. }