可能重複:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in selectmysql_num_rows()預計參數1是登記表格上資源錯誤消息
我正在與兩個MySQL表對應一個登記表上我的數據庫。
- 用戶登陸 - 包含所有與該網站
- userlogin_fb註冊的詳細信息 - 包含使用FB連接設備
現在,用戶的所有細節,當用戶註冊後不能有一個衝突用戶名或郵箱地址。我現在推行的驗證碼在兩個表檢查的電子郵件地址(這將被用來作爲用戶名的驗證參考):
,但我不斷收到以下錯誤信息:
警告:mysql_num_rows()預計 參數1是資源,布爾 在register.php給出線144
我怎麼去有關解決呢?
//select all rows from our users table where the emails match
$res1 = mysql_query("SELECT * FROM `userloginl.email`,`userlogin_fb.email` WHERE `email` = '".$email."'");
$num1 = mysql_num_rows($res1);
//if the number of matchs is 1
if($num1 == 1){
//the email address supplied is taken so display error message
echo "<center>The <b>e-mail</b> address you supplied is already taken</center>";
include_once ("resources/php/footer.php");
exit;
}else{
//finally, otherwise register there account }
任何幫助將不勝感激 - 謝謝!