<td width="1300" align="right" > <form action="search.php" method="post" name="search"> <div align="right">Search : <select> <option value="product_id">Product P/N</option> <option value="product_des">Product_des</option> <option value="serial">Serial</option> </select> <input type="text" name="search" /> <input name="submit" type="image" value="Search" src="images/home/icon_find.png" align="right" width="25" height="23" /> </div> </form></td> </tr> <tr> <td height="299" width="1200" colspan="2" valign="top" background="images/center.png" > <form action="select.php" name="check[]" method="post" > <table align="right"> <tr> <td align="right"> <input type="submit" name="submit" size="30" value="Submit" onclick="return confirm('ยืนยันการExport')"/ > <input type="reset" name="reset" value="reset" /> </td> </tr> </table> </br> <form action="select2.php" name="check[]" method="post" ><input type="hidden" name="id" value="<?=$data['id'];?>" /></br> <?php //ถ้ามีการส่งค่าข้อมูล $search = $_POST['search']; if(isset($search) ) { echo "<font size='-1' color='#FF0033'>ผลลัพธ์ของคำว่า [ $search ] </font><br />"; ?> <table id="mytable" border="1" align="center" width="1280" class="fix" > <tr > <td height="51" align="center" ><font color="#CCCCCC" size="+1">No.</font></td> <td align="center"><font color="#CCCCCC" size="+1">Product P/N</font></td> <td align="center"><font color="#CCCCCC" size="+1"><p>Product Description</p> </font></td> <td align="center"><font color="#CCCCCC" size="+1">Start</font></td> <td align="center"><font color="#CCCCCC" size="+1">End</font></td> <td align="center"><font color="#CCCCCC" size="+1">Transaction Details</font></td> <td align="center"><font color="#CCCCCC" size="+1">Serial</font></td> <td align="center"><font color="#CCCCCC" size="+1">Project</font></td> <td align="center"><font color="#CCCCCC" size="+1">Transaction Code</font></td> <td align="center" ><font color="#CCCCCC" size="+1">Image</font></td> <td align="center"><font color="#CCCCCC" size="+1">Edit</font></td> <td align="center"><font color="#CCCCCC" size="+1">Delete</font></td> <td align="center"><font color="#CCCCCC" size="+1">Select</font></td> </tr> <tbody> <?php include_once"connect.php"; $n=0; $result = mysql_query("SELECT * FROM stock where product_id like '$search%' OR product_des like '$search%' OR serial like '$search%' "); $num =mysql_num_rows($result)or die (mysql_error()); echo "<font size='-1' color='green'>ค้นพบทั้งหมด :: [ $num ] </font><br />"; $sql = "select * from stock where product_id like '$search%' OR product_des like '$search%' OR serial like '$search%' "; $view = mysql_query($sql); while ($data =@mysql_fetch_array($view)) { ?> <tr > <td align="center" ><? echo ++$n ?></td> <td width="200" ><?=$data['product_id'];?></td> <td class="fix"><?=$data['product_des'];?></td> <td width="180" align="center"><?=$data['start_date'];?></td> <td width="180" align="center"><?=$data['end_date'];?></td> <td width="800"><?=$data['detail'];?> </td> <td class="fix"><?=$data['serial'];?></td> <td class="fix" ><a href="stock.php"><?=$data['project'];?></a></td> <td width="25" align="center"><?=$data['trans_code'];?></td> <td ><a href="../myproject/storeimage/<?=$data['image'];?>"><center><img src='<?=$data['image'];?>' /></center></a></td> <td title="Edit" ><a href="stock.php?id=<?=$data['id'];?>"><img src="images/home/edit2.png" /></a></td> <td align="center" title="Delete" ><a href="stock_delete.php?id=<?=$data['id'];?>" onclick="return confirm('ยืนยันการลบ')"><img src="images/home/dele.gif" /></a></td> <td align="center" title="Export"> <a href="select.php?id=<?=$data['id'];?>"> <input type="checkbox" name="id[]" id="id[]" value="<?=$data['id'];?>" /></a></td> </tr> <?php } //End while loop } else {?> <?php include_once"connect.php"; $sql="select * from stock"; $rs=mysql_query($sql); ?> <table id="mytable" border="1" align="center" width="1280" class="fix" > <tr > <td height="51" align="center" ><font color="#CCCCCC" size="+1">No.</font></td> <td align="center"><font color="#CCCCCC" size="+1">Product P/N</font></td> <td align="center"><font color="#CCCCCC" size="+1"><p>Product Description</p> </font></td> <td align="center"><font color="#CCCCCC" size="+1">Start</font></td> <td align="center"><font color="#CCCCCC" size="+1">End</font></td> <td align="center"><font color="#CCCCCC" size="+1">Transaction Details</font></td> <td align="center"><font color="#CCCCCC" size="+1">Serial</font></td> <td align="center"><font color="#CCCCCC" size="+1">Project</font></td> <td align="center"><font color="#CCCCCC" size="+1">Transaction Code</font></td> <td align="center" ><font color="#CCCCCC" size="+1">Image</font></td> <td align="center"><font color="#CCCCCC" size="+1">Edit</font></td> <td align="center"><font color="#CCCCCC" size="+1">Delete</font></td> <td align="center"><font color="#CCCCCC" size="+1">Select</font></td> </tr> <tbody> <?php while($show=mysql_fetch_assoc($rs)) { ?> <tr > <td align="center" ><? echo ++$n ?></td> <td width="200" ><?=$show['product_id'];?></td> <td class="fix"><?=$show['product_des'];?></td> <td width="180" align="center"><?=$show['start_date'];?></td> <td width="180" align="center"><?=$show['end_date'];?></td> <td width="800"><?=$show['detail'];?> </td> <td class="fix"><?=$show['serial'];?></td> <td class="fix" ><a href="stock.php"><?=$show['project'];?></a></td> <td width="25" align="center"><?=$show['trans_code'];?></td> <td ><a href="../myproject/storeimage/<?=$show['image'];?>"><center><img src='<?=$show['image'];?>' /></center></a></td> <td title="Edit" ><a href="stock.php?id=<?=$show['id'];?>"><img src="images/home/edit2.png" /></a></td> <td align="center" title="Delete" ><a href="stock_delete.php?id=<?=$show['id'];?>" onclick="return confirm('ยืนยันการลบ')"><img src="images/home/dele.gif" /></a></td> <td align="center" title="Export"> <a href="select.php?id=<?=$show['id'];?>"> <input type="checkbox" name="id[]" id="id[]" value="<?=$show['id'];?>" /></a></td> </tr> <? }?> </table> <? } ?> </table> </form> </table>
$sql = mysql_query("SELECT * FROM Product WHERE $topic like '$search%' ");
<select name="topic"> /// ใส่ชื่อด้วยครับ <option value="product_id">Product P/N</option> <option value="product_des">Product_des</option> <option value="serial">Serial</option> </select>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง