<?php Conn2DB(); $strSQL = "SELECT * FROM product "; $strSQL = $strSQL . "WHERE cate_id=1"; /* ตั้งค่า แสดงผลต่อหน้า $Per_Page */ $Per_Page =5; if(!$Page) $Page=1; $Prev_Page = $Page-1; $Next_Page = $Page+1; $result = mysql_query($strSQL); $Page_start = ($Per_Page*$Page)-$Per_Page; $Num_Rows = mysql_num_rows($result); if($Num_Rows<=$Per_Page) $Num_Pages =1; else if(($Num_Rows % $Per_Page)==0) $Num_Pages =($Num_Rows/$Per_Page) ; else $Num_Pages =($Num_Rows/$Per_Page) +1; $Num_Pages = (int)$Num_Pages; if(($Page>$Num_Pages) || ($Page<0)) print "<center><b>จำนวน $Page มากกว่า $Num_Pages ยังไม่มีข้อความ<b></center>"; $sql.= " WHERE cate_id=1 LIMIT $Page_start , $Per_Page"; //ตรงนี้เปลี่ยนเป็น $strSQL จะฟ้องทันที $result = mysql_query( $strSQL,$conn ); $num = mysql_num_rows( $result ); $swap = "2"; while ( $rs = mysql_fetch_array( $result ) ) { if ( $swap == "1" ) { $color = "#EAEAEA"; $swap = "2"; } else { $color = "#EAEAEA"; $swap = "1"; } echo "<tr valign=\"top\" bgcolor=\"$ffffff\">\n"; echo "<td class=\"b01\" width=\"29%\"><center>"; echo "<img src=\"ProductImage/$rs[pro_image]\" width=\"60\" height=\"60\"</a></td>\n"; echo "<td class=\"b01\" width=\"32%\">"; echo "<a href=\"pro_detial.php?pro_id=$rs[pro_id]\">$rs[pro_title]</a></td>\n"; echo "<td class=\"b01\" width=\"21%\">$rs[pro_time]</td>\n"; if ($rs[pro_unit] <= 0){ echo "<td class=\"b01\" width=\"18%\">สินค้าหมด</td>\n"; } else {echo "<td class=\"b01\" width=\"18%\"></td>\n"; } echo "<td class=\"b01\" width=\"20%\" align=\"right\">"; echo number_format( $rs[pro_price], 2, '.', ',' ); echo "</td>\n"; echo "</tr>\n"; } echo "<tr>"; echo "<td class=\"b01\" colspan=\"4\"><br><b>สินค้ามีทั้งหมด $num รายการ</b></td>"; echo "</tr>"; CloseDB(); ?>
$sql.= " WHERE cate_id=1 LIMIT $Page_start , $Per_Page"; //ตรงนี้เปลี่ยนเป็น
$strSQL.= " LIMIT $Page_start , $Per_Page"; //ตรงนี้เปลี่ยนเป็น
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง