<? $objConnect = mysql_connect("localhost","root","abcd1234") or die("Error Connect to Database"); mysql_query("SET NAMES UTF8"); $objDB = mysql_select_db("thaimee"); $strSQL = "SELECT * FROM product"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 5; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); 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; } $strSQL .=" order by FilesID ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> </p> <table width="200" border="0" align="center"> <tr> <td><img src="picture/logo.png" width="150" height="100"></td> </tr> </table> <tr> <table width="200" border="0" align="right"> <tr> <td><form name="form1" method="post" action="search_product.php"> <input type="submit" name="button" id="button" value="search"> </form></td> </tr> </table> <tr> </tr> <table width="200" border="0"> <tr> <th scope="row"><form id="form2" name="form2" method="post" action="product_thaistyle.php"> <input type="submit" name="button2" id="button2" value="ThaiStyle" /> </form></th> </tr> </table> <table width="200" border="0"> <tr> <th scope="row"><form id="form3" name="form3" method="post" action="product_Processed.php"> <input type="submit" name="button3" id="button3" value="Processed Fruit" /> </form></th> </tr> </table> <table width="200" border="0"> <tr> <th scope="row"><form id="form4" name="form4" method="post" action="product_candy.php"> <input type="submit" name="button4" id="button4" value="Candy" /> </form></th> </tr> </table> </form> <form id="form5" name="form5" method="post" action=""> </form> </tr> <tr> <td> </td> </tr> <table width="1416" height="75" border="1"> <tr> <th width="85" height="31"> <div align="center">ProductID </div></th> <th width="212"> <div align="center">Productname</div></th> <th width="229"> <div align="center">Product description</div></th> <th width="155"> <div align="center">Product thaimee</div></th> <th width="191"> <div align="center">Product Picture</div></th> <th width="96"> <div align="center">Shelf Life</div></th> <th width="96"> <div align="center">Availble flavor</div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td height="36"><div align="center"><?=$objResult["FilesID"];?></div></td> <td><center><?php echo $objResult["Productname"];?></center></td> <td><center><?php echo $objResult["Product description"];?></center></td> <td><center><?php echo $objResult["Product thaimee"];?></center></td> <td><center> <a href="product packing.php"><img src="ViewImage_product.php?FilesID=<?=$objResult["FilesID"];?>"></a> </center></td> <td><center><?php echo $objResult["Shelf Life"];?></center></td> <td><center><?php echo $objResult["Availble flavor"];?></center></td> <?php } ?> </table> <br> Total <?php echo $Num_Rows;?> Record : <?php echo $Num_Pages;?> Page : <?php if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } mysql_close($objConnect); ?> </body> </html> </body> </html>
<? $objConnect = mysql_connect("localhost","root","abcd1234") or die("Error Connect to Database"); $objDB = mysql_select_db("thaimee"); $strSQL = "SELECT * FROM packing INNER JOIN product ON(packing.FilesID = product.FilesID)ORDER BY packing.FilesID DESC"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); ?> </p> <table width="200" border="0" align="center"> <tr> <td><img src="picture/logo.png" width="150" height="100"></td> </tr> </table> <table width="200" border="0" align="right"> <tr> <td><form name="form1" method="post" action="search_seafood.php"> <input type="submit" name="button" id="button" value="search"> </form></td> </tr> </table> <table width="200" border="0"> <tr> <th scope="row"><form id="form2" name="form2" method="post" action="product_candy.php"> <input type="submit" name="button2" id="button2" value="Candy" /> </form></th> </tr> </table> <table width="200" border="0"> <tr> <th scope="row"><form id="form3" name="form3" method="post" action="product_snack.php"> <input type="submit" name="button3" id="button3" value="Snack" /> </form></th> </tr> </table> <table width="200" border="0"> <tr> <th scope="row"><form id="form4" name="form4" method="post" action="product_seafood.php"> <input type="submit" name="button4" id="button4" value="Seafood" /> </form></th> </tr> </table> </form></td> </tr> <tr> <td> </td> </tr> <table width="1416" height="111" border="1"> <tr> <th width="84" height="31"> <div align="center">Productname</div></th> <th width="226"> <div align="center">Packing</div></th> <th width="226"> <div align="center">Price</div></th> <th width="144"> <div align="center">Boxsize</div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><Left><?php echo $objResult["Productname"];?></center></td> <td><center><?php echo $objResult["Packing"];?></center></td> <td><center><?php echo $objResult["price"];?></center></td> <td><center><?php echo $objResult["Boxsize"];?></center></td> </tr> <? } ?> </table> <? mysql_close($objConnect); ?> </body> </html>
Quote: $objConnect = mysql_connect("localhost","root","abcd1234") or die("Error Connect to Database"); $objDB = mysql_select_db("thaimee"); $strSQL = "SELECT * FROM packing INNER JOIN product ON(packing.FilesID = product.FilesID)ORDER BY packing.FilesID DESC";
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database"); $objDB = mysql_select_db("mydatabase"); $strSQL = "SELECT * FROM customer WHERE CustomerID = '".$_GET["CusID"]."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery);
$strSQL = "SELECT * FROM packing WHERE FilesID = '".$_GET["FilesID"]."' "; " INNER JOIN product ON(packing.FilesID = product.FilesID)ORDER BY packing.FilesID DESC";
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง