ช่วยด้วยครับ แก้ยังไงครับ
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\com_project\showstudent.php on line 39
โค้ด
[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้
<? session_start();
if(isset($_SESSION["valid_uname"]) && isset($_SESSION["valid_pwd"])){
?>
<?
include "connect.php";
$sql = "SELECT student.St_id,student.St_name,year.Y_na,student.St_ad,student.St_mail FROM student,year WHERE student.Y_id=year.Y_id ";
$result = mysql_query($sql,$conn);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
include "head.php";
include "admin_menu.php";
include "bg.php";
?>
<table width="922" height="252" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<tr bordercolor="#00FFFF">
<td width="918" height="250"><p align="center">รายงานข้อมูลนักเรียน</p>
<table width="892" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="7"><div align="right">[ <a href="frm_student.php">เพิ่มข้อมูลนักเรียน</a> ]</div></td>
</tr>
<tr>
<td width="104" align="center">รหัสนักเรียน</td>
<td width="153" align="center">ชื่อ-สกุล</td>
<td width="146" align="center">ชั้นปี</td>
<td width="154" align="center">ที่อยู่</td>
<td width="138" align="center">E-mail</td>
<td width="86"> </td>
<td width="89"> </td>
</tr>
<?
while ($rs = mysql_fetch_array($result)) {
?>
<tr>
<td><? echo "$rs[St_id]"; ?></td>
<td><? echo "$rs[St_name]"; ?></td>
<td><? echo "$rs[Y_na]"; ?></td>
<td><? echo "$rs[St_ad]"; ?></td>
<td><? echo "$rs[St_mail]"; ?></td>
<td align="center"><? echo "<a href=\"frm_editstudent.php?St_id=$rs[St_id]\">" ?> แก้ไข <? echo "</a>"; ?></td>
<td align="center"><div align="center"> <? echo "<a href=\"frm_delstudent.php?St_id=$rs[St_id]\">" ?> ลบ <? echo "</a>"; ?></div></td>
<td width="0"><div align="center"></div></td>
<td width="2"> </td>
</tr>
<?
}
?>
</table>
<p> </p></td>
</tr>
</table>
<?
include"foot.php";
?>
</body>
</html>
<?
}else{
echo"<script> alert('login Please'); window.location='frm_login_admin.php';</script>";
exit();
}
?> ขอบคุณครับ
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\com_project\showstudent.php on line 39
โค้ด[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้ ขอบคุณครับ