0
我正在使用JQuery驗證插件。我得到了遠程函數與默認的PHP文件。JQuery驗證遠程和檢查數據庫PHP MySQL錯誤
我修改了PHP文件用我自己的版本,但MySQL是返回
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/fastbluf/syatch/module/1.func.php on line 15
我的PHP代碼如下。我的所有語法看起來都正確
<?php
// Last Edited: 4/23/12
$conn = mysql_connect('localhost','hidden','hidden') or die('Iam dying');
$rs = @mysql_select_db("hidden", $conn) or die("Err:Db");
$do = $_REQUEST['do'];
$email= $_REQUEST['email'];
$user= $_REQUEST['user'];
function checkInfo($do,$email,$user){
switch ($do) {
case 1:
$sql = "select * from User_Base where Email_Address = $email";
$results = mysql_query($sql). mysql_error();
$nResults = mysql_num_rows($results);
if ($nResults > 0) {
$valid="false";
} else {
$valid="true";
}
break;
case 2:
//not yet
break;
}
return $valid;
}
echo checkInfo($do,$email,$user);
?>
謝謝。很多..甚至沒有跟蹤真正的逃生字符串..病必須實現,無處不在現在.. – Ray 2012-04-23 19:09:27
沒問題,很高興我可以幫助:) – Developer 2012-04-23 19:09:55