<? //session_start(); /* if($_SESSION['Emp_ID'] == "") { echo "Please Login!"; exit(); } if($_SESSION['Status'] != "ADMIN") { echo "This page for User only!"; exit(); } mysql_connect("localhost","root","root"); mysql_select_db("laundry"); $strSQL = "SELECT * FROM employee WHERE Emp_ID = '".$_SESSION['Emp_ID']."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); */ ?> <?php $host = "localhost"; $user = "root"; $pass = "root"; $dbname = "ld2"; mysql_connect($host, $user, $pass); mysql_select_db($dbname); mysql_query("SET NAMES UTF8"); /*$sql = "SELECT * FROM Product WHERE Seller_ID = Seller_ID"; $rs = mysql_query($sql) or die (mysql_error()); $sql2 = "SELECT * FROM Seller WHERE Seller_ID = Seller_ID"; $rs2 = mysql_query($sql2); */ $Sql = "SELECT * FROM Seller RIGHT JOIN Product ON Seller.Seller_ID = Product.Seller_ID"; $rs = mysql_query($sql) or die (mysql_error()); ?> <html> <head> <title>แสดงรายการสินค้า</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> .style1 {font-size: xx-large; color: #0000FF; } .style12 {font-family: "Angsana New"} body { background-image: url(1043574020.jpg); } </style> </head> <body> <table width="100%" height="130" border="1"> <tr> <th height="87" colspan="4" scope="col"><strong><span class="style1">ระบบบริการการจัดการร้านซักรีดออนไลน์</span></strong></th> </tr> <tr> <th width="152" height="37" scope="col"><span class="style12"><a href="HomePage.php">หน้าแรก</a></span></th> <th scope="col"><a href="Product.php">รายการสินค้า</a></th> <th scope="col"><a href="Member.php">รายชื่อลูกค้า</a></th> <th scope="col"><a href="#">รายการแจ้งซักรีด</a></th> </tr> </table> <p align="center"> </p> <table width="100%" border="0"> <tr> <th width="173" scope="row"><div align="left"></div></th> <th width="996" colspan="4" valign="top" scope="col"><div align="left"> <meta http-equiv=Content-Type content="text/html; charset=utf-8"> <p><br> <div align="left"> <p>รายการสินค้า</p> <form name="form1" method="post" action="ProductSearch.php"> <input type="submit" name="button" id="button" value="ค้นหา"> <label for="search2"></label> <input type="text" name="search" id="search2"> <p><a href="ProductAdd.html">เพิ่มสินค้า</a></p> <table width="600" border="1"> <tr> <th>รหัสสินค้า</th> <th>รหัสผู้จัดจำหน่าย</th> <th>ชื่อสินค้า</th> <th>จำนวน</th> <th>ประเภท</th> <th>คำสั่ง</th> </tr> <?php while($row = mysql_fetch_array($rs)) { echo "<tr>" . "<td align='center'>" . $row['Product_ID'] . "</td>" . "<td align='center'>" . $row['Seller_ID'] . "</td>" . "<td>" . $row['Seller_Name'] . "</td>" . "<td align='center'>" . $row['Quantity'] . "</td>" . "<td>" . $row['Product_Type'] . "</td>" . "<td align='center'>" . "<a href='ProductEdit.php?Product_ID=" . $row['Product_ID'] . "'>แก้ไข</a> " . "<a href='ProductDelete.php?Product_ID=" . $row['Product_ID'] . "'>ลบ</a> " . "<a href='Order.php?Order_ID=" . $row['Product_ID'] . "'>สั่งซื้อเพิ่ม</a>$nbsp" . "</td>". "</tr>"; } ?> </table> </form> </div> </div></th> </tr> </table> <p align="center"> </p> <p align="center"> </p> </body> </html>
SELECT Seller.*,Product.* FROM Seller RIGHT JOIN Product ON Seller.Seller_ID = Product.Seller_ID";
$sql = "SELECT Seller.*,Product.* FROM Seller RIGHT JOIN Product ON Seller.Seller_ID = Product.Seller_ID"; $rs = mysql_query($sql) or die (mysql_error());
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง