我已試圖檢查sql數據庫中存在的行,但它總是返回此錯誤。我試圖研究他們提供了一些解決方案,但不工作。請幫忙!!Mysql_num_row()期望參數1是資源
$usersexist = mysqli_query($con, "SELECT phone FROM usersacc WHERE phone = '$pho'");
$count= mysql_num_rows($usersexist) or die(mysql_error());
if($count > 0)
{
$result_data = array(
'ResultArray' => 'Exist',
);
}
else
{
mysqli_query($con,"INSERT INTO usersacc
(phone, password) VALUES('$pho', '$pass')");
#Build the result array (Assign keys to the values)
$result_data = array(
'ResultArray' => 'success',
);
}
#Output the JSON data
echo json_encode($result_data);
我想你的意思mysqli_error()有 – 2014-11-25 07:33:50
yup..missed那一個。謝謝。 :) – 2014-11-25 07:35:12
很多,我得到那 – 2014-11-25 07:37:06