โค้ด: เลือกทั้งหมด
<?
require("Config.php");
require("connectdb.php");
$sql="SELECT lineitem.priority, header.troubleno, header.ticketno, header.device, header.firstdate, header.enddate, header.totaldate ".
" FROM lineitem LEFT JOIN header ON lineitem.troubleno = header.troubleno ".
/*"ORDER BY troubleno ASC";*/
$result = mysql_query($sql,$conn);
?>
<!----------------------------------------------------------------------------------------------------------------------------------->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>List of Priority No.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!----------------------------------------------------------------------------------------------------------------------------------->
<script language="javascript">
function settroubleno(troubleno)
{
window.opener.location.href="troubleshooting.php?troubleno="+troubleno;
window.close();
}
</script>
<!----------------------------------------------------------------------------------------------------------------------------------->
</head>
<body>
<form name="form1" method="post" action="">
<table width="1143" border="0">
<tr>
<th width="139" scope="col">Priority Rate</th>
<th width="110" scope="col">Trouble No.</th>
<th width="175" scope="col">Ticket No.</th>
<th width="290" scope="col">Device</th>
<th width="130" scope="col">Found date</th>
<th width="130" scope="col">Fix date</th>
<th width="139" scope="col">Total day used</th>
</tr>
<!----------------------------------------------------------------------------------------------------------------------------------->
<?
$dataHtml="";
[color=#FF0000]while(list($priority, $troubleno, $ticketno, $device, $firstdate, $enddate, $totaldate)=mysql_fetch_row($result))
{
$dataHtml.="<tr>\n";
$dataHtml.="<td bgcolor=\"#FFFFCC\"><div align=\"center\">$priority</div></td>\n";
$dataHtml.="<td bgcolor=\"#FFFFCC\"><div align=\"center\">$roubleno</div></td>\n";
$dataHtml.="<td bgcolor=\"#FFFFCC\"><div align=\"center\">$ticketno</div></td>\n";
$dataHtml.="<td bgcolor=\"#FFFFCC\"><div align=\"center\">$device</div></td>\n";
$dataHtml.="<td bgcolor=\"#FFFFCC\"><div align=\"center\">$firstdate</div></td>\n";
$dataHtml.="<td bgcolor=\"#FFFFCC\"><div align=\"center\">$enddate</div></td>\n";
$dataHtml.="<td bgcolor=\"#FFFFCC\"><div align=\"center\">$totaldate</div></td>\n";
$dataHtml.="</tr>\n";
}
echo $dataHtml;
mysql_free_result($result);[/color]
?>
<!----------------------------------------------------------------------------------------------------------------------------------->
</table>
</form>
</body>
</html>
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\ProjectPhp\prioritynolist.php on line 53
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\ProjectPhp\prioritynolist.php on line 67
(บรรทัดสีนะครับ 53-67) ต้องแก้ตรงไหนบ้างหรอครับ ขอบคุณครับ