mysql 的 PHP Select 语句问题
我得到这个错误..
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/try/public_html/register.php on line 17
我的代码是
$siteAddress = trim($_POST['b_Address']);
$sql="SELECT * FROM user WHERE siteAddress='$siteAddress';";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
//check for address
if($count)
{
$errorMessage = "<p><font color=red size=4>Site Address " . $siteAddress . " is not available. </font></p>";
$proceed = "no";
}
我尝试 echo $sql ,我得到了这个
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/try/public_html/register.php on line 17
SELECT * FROM user WHERE siteAddress='myshop';
如果我在 phpmyadmin 输入 sql 它会返回一些东西..
Showing rows 0 - 0 (1 total, Query took 0.0003 sec)