|
 |
|
อยากให้ช่วยเรื่อง การแสดงตาราง โดยการวน loop หน่อยครับ |
|
 |
|
|
 |
 |
|

จากภาพ ปัญหาคือ ตารางมันวนลูป ไล่ลงล่างมาเรื่อยๆ ซึ่งผมอยากให้มันเปลี่ยนจาก ลงล่าง เป็น ไปทางขวา พอครบกำหนด อาจจะสัก 3-4 รายการ ก็ให้มันวนมาที่ ซ้ายล่าง เป็นแถวที่ 2 ต่อจากแถวที่ 1 อีกที สามารถทำได้ไหมครับ
Code (PHP)
<? include "connect.php"; ?>
<?
$run = $_REQUEST['id'];
$sql = "SELECT main_id, main_no, main_name, main_course.listmenu_id, main_course.setmenu_id, listmenu_name, listmenu_picture, list_menu.menutype_id, menutype_name
FROM main_course, set_menu, list_menu, menu_type
WHERE main_course.listmenu_id = list_menu.listmenu_id
AND main_course.setmenu_id = set_menu.setmenu_id
AND list_menu.menutype_id = menu_type.menutype_id
AND main_course.setmenu_id = '$run' ";
$que = mysql_query($sql);
while($read = mysql_fetch_array($que)){
?>
<link href="SmallContent.css" rel="stylesheet" type="text/css">
<table width="145" height="166" border="0" cellpadding="0" cellspacing="2">
<tr>
<td width="158" bgcolor="#99CC66">><? echo $read['menutype_name'] ?></td>
</tr>
<tr>
<td bgcolor="#99CC66">
<input type="hidden" name="txt_id" value="<? echo $read['listmenu_id'] ?>" /><? echo $read['listmenu_name'] ?></td>
</tr>
<tr>
<td bgcolor="#99CC66">><img src="<? echo $read['listmenu_picture']; ?>" width="100" height= "100" /></td>
</tr>
</table>
<? } ?>
Tag : PHP, MySQL, HTML/CSS, CakePHP

|
|
 |
 |
 |
 |
Date :
2012-02-28 21:14:08 |
By :
sauzemackie |
View :
2200 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

อันนี้คือที่กล่าวถึงนะครับ ที่ว่าให้ส่งข้อมูล ID มาทั้งหมด โดยใช้การกดปุ่ม ทำไงดีครับ ในการรับข้อมูล ไปลงฐานข้อมูล ?

อันนี้ คือ ผลจากที่ส่ง Key มาให้ ลองทำดูได้แล้วนะครับ ใช้ " %3 "
|
 |
 |
 |
 |
Date :
2012-02-28 22:26:03 |
By :
sauzemackie |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|