include 'connect.php';$sql = "select * from product where Name like '%'$_POST['Name']'%'";$query = mysql_query($sql);
<div class="col-md-12"><table class="table table-bordered"> <thead> <tr> <th>ลำดับ</th> <th>ชื่อผู้ขาย</th> <th>ชื่อสินค้า</th> <th>ประเภทสินค้า</th> <th>ราคา(฿)</th> <th>สี</th> <th>เพศ</th> </tr> </thead> <tbody> <?php $i=1; while ($result = mysql_fetch_assoc($query)) { ?> <tr> <td> <?php echo $i; ?> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <?php $i++; } ?> </tbody> </table> </div>
<?phpinclude 'connect.php';$sql = "select * from product where Name like '%'$_POST['Name']'%'";$query = mysql_query($sql); //เพิ่มเติมส่วนนี้ครับ?><table><tr> <th>ลำดับ</th> <th>ชื่อผู้ขาย</th> <th>ชื่อสินค้า</th> <th>ประเภทสินค้า</th> <th>ราคา(฿)</th> <th>สี</th> <th>เพศ</th></tr><?phpwhile ($row = mysql_fetch_assoc($query)) {?><tr> <td><?=$row['ลำดับ']?></td> <td><?=$row['ชื่อผู้ขาย']?></td> <td><?=$row['ชื่อสินค้า']?></td> <td><?=$row['ประเภทสินค้า']?></td> <td><?=$row['ราคา(฿)']?></td> <td><?=$row['สี']?></td> <td><?=$row['เพศ']?></td></tr><?php}?></table>
bamossza
พลังงานการช่วยเหลือ
( Level 3 )
( 16 )
ตอบกระทู้ ( 112 )
เขียนบทความ ( 28 )
Code (PHP)
ปล. <?=$row['เพศ']?> <--- ส่วนนี้ดึงมาจากฐานข้อมูลตามฟิวล์