Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\project\report.php on line 44 แก้ยังงัยครับ
แก้ตรงคำสั่ง Query ครับ
Date :
2015-05-14 15:49:12
By :
arm8957
Code (PHP)
<?php require_once('Connections/project.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
@session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
exit();
}
mysql_connect("localhost","root","root");
mysql_select_db("project");
$strSQL = "SELECT * FROM member,scorep WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
ยังงัยครับ
Date :
2015-05-14 15:56:10
By :
Saharatza
เช็ค $strSQL = "SELECT * FROM member,scorep WHERE UserID = '".$_SESSION['UserID']."' "; นี้ครับ
ลอง echo $strSQL; ออกมาดูก็ได้ครับว่าได้ค่า $_SESSION['UserID'] ถูกต้องหรือไม่?
Date :
2015-05-14 16:02:01
By :
arm8957
Column UserID มีหรือเปล่าครับ
Date :
2015-05-14 16:15:05
By :
mr.win
มีครับ นี้ึีครับ
Date :
2015-05-14 16:18:45
By :
Saharatza
แก้งัยดีครับแอดมิน
Date :
2015-05-14 16:46:22
By :
Saharatza
ประวัติการแก้ไข 2015-05-15 12:38:14
Date :
2015-05-15 12:32:32
By :
nirunsu
Load balance : Server 01