您好如何验证表格用户中是否有任何信息列这是我的完整脚本
<?php
$username = "root";
$password = "";
$hostname = "localhost";
$dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
$selected = mysql_select_db("demo1",$dbhandle) or die("Could not select demo1");
//$result_name = mysql_query(" SELECT `name` FROM `users` WHERE `name` != '' ");
$result_name = mysql_query("SELECT name FROM demo1. users");
while($row_name = mysql_fetch_array($result_name)) {
//echo "NAME=" . $row_name['name'] . "<br/>";
if ($row_name == null)
echo "NAME= no name <br/>";
else
{
echo "NAME=" . $row_name['name'] . "<br/>";
}
}
?>
我得到了结果,但是当没有名称时,即名称为空,我想输出“NAME= no name”,但我只得到“Name =” http://s23.postimg.org/ky8xcoy4b/Untitled_1.jpg 感谢任何人谁能帮忙