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)