HOME > PHP > PHP Forum > ช่วยดูโค้ดให้หน่อยค่ะ Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\student\report_extra_job.php on line 60 ตัวจริง
ช่วยดูโค้ดให้หน่อยค่ะ Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\student\report_extra_job.php on line 60 ตัวจริง
<?
// Real
$extra_id=$_GET["id"];
$SqlReal="Select student1.std_id,student1.std_name,student1.std_surname, central_c_faculty.FAC_NAME_THAI,student1.std_tel
FROM student1 LEFT JOIN std_extra_job ON student1.std_id= std_extra_job.std_id
LEFT JOIN central_c_faculty ON student1.std_department=central_c_faculty.FAC_ID WHERE
(student1.std_id = std_extra_job.std_id)
and (extra_job_id=".$extra_id.") and (backup_state=FALSE) ORDER BY student1.std_id";
$rsReal=mysql_query($SqlReal);
while ($rs_Real=mysql_fetch_array($rsReal))
{
?>
<tr>
<td> <? $rs_Real['std_id'] ?></td>
<td> <? $rs_Real['std_name'] ?></td>
<td> <? $rs_Real['std_surname'] ?></td>
<td> <? $rs_Real['FAC_NAME_THAI']?></td>
<td> <? $rs_Real['std_tel'] ?></td>
</tr>
<? } ?>
?>
$rsReal=mysql_query($SqlReal) or die(mysql_error());
ลองดูแบบนี้น่ะครับ
Date :
2011-08-23 16:14:18
By :
webmaster
No. 3
Guest
รันแล้วเป็นแบบนี้ค่ะ
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and (backup_state=FALSE) ORDER BY student1.std_id' at line 5