|
 |
|
Hele me!!!! ช่วยดูหน่อยนะค่ะ ตาลายแล้วอ่ะค่ะ มันคือ code แบ่งหน้าอ่ะค่ะ จา error บรรทัดที่ 78 ค่ะ |
|
 |
|
|
 |
 |
|
มันคือ code แบ่งหน้าอ่ะค่ะ จา error บรรทัดที่ 78 ค่ะ แต่พอเอาออกม่ายมี error แต่ข้อมูลไม่โชวว์เลยค่ะ จึงไม่ทราบว่าเราทำตรงไหนผิดหรือเปล่า รบกวนช่วยดูให้นิดส์นะค่ะ
Code (PHP)
<?php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>:: ระบบสั่งซื้อ และสต๊อกสินค้า >> รายงานข้อมูลซัพพลาย</title>
<style type="text/css">
*{
font-family: "MS Sans Serif";
}
.style1 {font-size: 12px}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
.style4 {font-size: 12px; color: #FF0000; }
</style>
<script type="text/javascript">
function openPopUp(w,h,url,name)
{
window.open(url,name,'scrollbars=yes,width=' + w + ',height=' + h)
}
</script>
</head>
<body>
<p>
<?
$rowsPerPage = 5; // จำนวนที่จะให้แสดงใน 1 หน้า
$nowPage = $page;
if ($nowPage == '')
$nowPage = 1;
$limit = (($page - 1) * $limitPerPage) . ','.$limitPerPage;
function LinkPage($totalRows , $rowsPerPage , $nowPage , $link)
{
$totalPage = ceil($totalRows/$rowsPerPage);
if ($nowPage != 1)
echo ' <a href="'. $link .'&page='. ($nowPage - 1) . '"><</a> | ';
else
echo ' < | ';
for ($i=0;$i<$totalPage;$i++)
{
if ($i>0)
echo ' | ';
if (($i+1) != $nowPage)
echo '<a href="'. $link .'&page=' . ($i+1) . '">'. ($i+1) . '</a>';
else
echo ($i+1);
}
if ($nowPage != $totalPage)
echo ' | <a href="'. $link .'&page='. ($nowPage + 1) . '">'. '>' . '</a> ';
else
echo ' | > ';
}
include "connect.php";
$sql = 'SELECT SQL_CALC_FOUND_ROWS * FROM tb_supply WHERE id_sup asc ';
$sql .= ' LIMIT '.$limit;
//$sql="select * from tb_supply order by id_sup asc ";
$result=mysql_db_query($dbname,$sql);
$c_res = mysql_query('SELECT FOUND_ROWS()');
$row = mysql_fetch_array($c_res);
$totalRows = $row[0];
$number=mysql_num_rows($result);
$no=1;
$link = 'show.php?cat=game&order=byname&stattus=1';
?></p>
<table width="910" align="center">
<tr>
<th scope="col"><div align="left"><img src="Images/paste.png" width="24" height="24" align="absmiddle" /> <span class="style4">Report </span><span class="style1">: รายงานรายชื่อซัพพลายทั้งหมด</span> </div></th>
</tr>
<tr>
<th scope="col"><div align="right"></div></th>
</tr>
<tr>
<th scope="col"><div align="right">
</div></th>
</tr>
<tr>
<th bgcolor="#0099FF" scope="col"><div align="right"></div></th>
</tr>
<tr>
<th scope="col">
<div align="left">
<?
if ($number<>0) {
echo "
<left><table width='100%' border='0' >
<TR BGCOLOR='#FF9900'>
<td width='3%'><center><b><font color='000000' font size='2' >no.</b></center></td>
<td width='4%'><center><b><font color='000000' font size='2' >รหัส</b></center></td>
<td width='12%'><center><b><font color='000000' font size='2' >ชื่อซัพพลาย</b></center></td>
<td width='6%'><center><b><font color='000000' font size='2' >ชื่อผู้ติดต่อ</b></center></td>
<td width='5%'><center><b><font color='000000' font size='2' >โทรศัพท์</b></center></td>
<td width='5%'><center><b><font color='000000' font size='2' >แฟกซ์</b></center></td>
<td width='20%'><center><b><font color='000000' font size='2' >ที่อยู่</b></center></td>
</TR> ";
while($rs=mysql_fetch_array($result)) {
$id_sup=$rs[id_sup];
$code_sup=sprintf("%04d",$id_sup);
$name_sup=$rs[name_sup];
$address_sup=$rs[address_sup];
$contact_name_sup=$rs[contact_name_sup];
$tel_sup=$rs[tel_sup];
$fax_sup=$rs[fax_sup];
echo "
<tr bgcolor='#FFFFCC'>
<td width='3%' ><center><font size='2' >$no</center></td>
<td width='4%' ><center><font size='2' >$code_sup</center></td>
<td width='12%' ><left><font size='2' >$name_sup</left></td>
<td width='6%' ><center><font size='2' >$contact_name_sup</center></td>
<td width='5%' ><center><font size='2' >$tel_sup</center></td>
<td width='5%' ><center><font size='2' >$fax_sup</center></td>
<td width='20%'><center><font size='2' >$address_sup</center></td>
</TR>";
$no++;
}
echo "</TABLE></left>";
LinkPage($totalRows , $rowsPerPage , $nowPage , $link);
mysql_close();
}
?>
</div></th>
</tr>
</table>
</BODY>
</HTML>
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-08-14 11:27:06 |
By :
gummezaka |
View :
901 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
SELECT SQL_CALC_FOUND_ROWS * FROM tb_supply WHERE id_sup asc
น่าจะเป็น
SELECT SQL_CALC_FOUND_ROWS * FROM tb_supply ORDER BY id_sup asc
|
 |
 |
 |
 |
Date :
2009-08-14 13:51:32 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแก้ Query ที่บรรทัด 69. ดูครับเผื่อได้
|
 |
 |
 |
 |
Date :
2009-08-14 14:55:30 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อะค่ะ ขอบคุงค่ะ พอดีทำได้แล้วอ่ะค่ะ
|
 |
 |
 |
 |
Date :
2009-08-14 19:53:53 |
By :
gummezaka |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|