|
|
|
ช่วยดูไฟล์ php ให้หน่อยค่ะมัน error ค่ะ mysql_fetch_array(): supplied argument is not a valid MySQL result resource |
|
|
|
|
|
|
|
Code (PHP)
<?
$objConnect = mysql_connect("localhost","root","root");
$objDB = mysql_select_db("movedb,tplibrary");
$strID = $_POST["sID"];
$strPassword = $_POST["sPassword"];
$strMEM_ID=$_POST["sMEM_ID"];
$strSQL = "SELECT * FROM member WHERE 1
AND ID = '".$strID."'
AND Password = '".$strPassword."'
AND MEM_ID = '".$strMEM_ID."'
";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
$intNumRows = mysql_num_rows($objQuery);
if($intNumRows==0)
{
$arr["Status"] = "0";
$arr["ID"] = "0";
$arr["MEM_ID"] = "0";
$arr["Message"] = "Username and Password ไม่ถูกต้อง";
echo json_encode($arr);
exit();
}
else
{
$arr["Status"] = "1";
$arr["ID"] = $objResult["ID"];
$arr["MEM_ID"]=$objResult["MEM_ID"];
$arr["Message"] = "Login Successfully";
echo json_encode($arr);
exit();
}
/**
return
// (0=Failed , 1=Complete)
// ID,MEM_ID
// Error Message
*/
mysql_close($objConnect);
?>
มัน error
JPG file type is wrong (*.jpg only)
Tag : Mobile, MySQL, iOS, iPhone, Objective-C, Mac
|
|
|
|
|
|
Date :
2013-11-29 14:34:41 |
By :
fern105 |
View :
822 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|