|
 |
|
อยากทำแบบ ให้แสดงสองคอลัมน์ รึว่า สองรายการคู่กันน่ะครับ จะทำอย่างไงดีครับ จากภาพน่ะครับ |
|
 |
|
|
 |
 |
|

PHP MySQL Multiple Column
|
 |
 |
 |
 |
Date :
2013-07-12 14:09:26 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จะรบกวนเพื่อนมากไปมั้ยครับ ถ้าจะให้ช่วยแก้ code ด้านบนให้หน่อยน่ะครับ เพราะว่า ยังหาทางไม่เจอ ดูตัวอย่างแล้วครับ
|
 |
 |
 |
 |
Date :
2013-07-12 14:13:54 |
By :
joolawan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้ ผมลองแก้แล้ว ได้ตามภาพ

แต่ปัญหาอยู่ที่ว่า ผมอยากได้ ค่าของ 1 ,SVC-250RAX, 100 มันเยื้องตรงเป็นแนวเดียวกันน่ะครับ รบกวนเพื่อนๆ ด้วย code ล่าสุดของผมคือ
<?
//session_start();
//session_destroy();
?><html>
<head>
<title>ThaiCreate.Com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
var stile = "top=0, left=0, width=500, height=650 status=no, menubar=no, toolbar=no scrollbar=no";
function Popup(apri) {
window.open(apri, "", stile);
}
//-->
</script></head>
<?
mysql_connect("localhost","root","laekarat");
mysql_select_db("ecommerce");
$strSQL = "SELECT * FROM product";
$objQuery = mysql_query($strSQL) or die(mysql_error());
echo"<table border=\"0\" align=\"center\" cellspacing=\"20\" cellpadding=\"20\"><tr>";
$intRows=0;
while($objResult = mysql_fetch_array($objQuery))
{
echo"<td>";
$intRows++;
?>
<left>
<a href="javascript:Popup('view_product.php?photo=<?=$objResult['Picture'];?>')"> <img src="img/<?=$objResult["Picture"];?>" width="100" height="150"><br>
ลำดับที่ <?=$objResult["ProductID"];?><br>
โมเดล <?=$objResult["ProductName"];?><br>
ราคา <?=$objResult["Price"];?><br>
<a href="order.php?ProductID=<?=$objResult["ProductID"];?>">Order</a><br>
</left>
<?
echo "</td>";
if (($intRows)%3==0)
{
echo"</tr>";
}
}
echo"</tr></table>";
?>
</table>
<br><br><a href="show.php">View Cart</a> | <a href="clear.php">Clear Cart</a>
<?
mysql_close();
?>
</body>
</html>
<?/* This code download from www.ThaiCreate.Com */ ?>
|
 |
 |
 |
 |
Date :
2013-07-12 15:56:05 |
By :
joolawan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ เดี๋ยวมีคำถามใหม่นะครับ
<?
//session_start();
//session_destroy();
?><html>
<head>
<title> Product ที่มีขาย</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
var stile = "top=0, left=0, width=500, height=650 status=no, menubar=no, toolbar=no scrollbar=no";
function Popup(apri) {
window.open(apri, "", stile);
}
//-->
</script></head>
<?
mysql_connect("localhost","root","laekarat");
mysql_select_db("ecommerce");
$strSQL = "SELECT * FROM product";
$objQuery = mysql_query($strSQL) or die(mysql_error());
echo"<table border=\"0\" align=\"center\" cellspacing=\"20\" cellpadding=\"20\"><tr>";
$intRows=0;
while($objResult = mysql_fetch_array($objQuery))
{
echo"<td>";
$intRows++;
?>
<left>
<a href="javascript:Popup('view_product.php?photo=<?=$objResult['Picture'];?>')"> <img src="img/<?=$objResult["Picture"];?>" width="100" height="150"></a>
<table border="0">
<tr>
<td>ลำดับที่</a></td>
<td><?=$objResult["ProductID"];?>
</a></td>
</tr>
<tr>
<td>โมเดล</a></td>
<td><?=$objResult["ProductName"];?>
</a></td>
</tr>
<tr>
<td>ราคา </a></td>
<td><?=$objResult["Price"];?>
</a></td>
</tr>
</table>
<a href="javascript:Popup('view_product.php?photo=<?=$objResult['Picture'];?>')"><a href="order.php?ProductID=<?=$objResult["ProductID"];?>">Order</a><br>
</left>
<?
echo "</td>";
if (($intRows)%3==0)
{
echo"</tr>";
}
}
echo"</tr></table>";
?>
</table>
<br><br><a href="show.php">View Cart</a> | <a href="clear.php">Clear Cart</a>
<?
mysql_close();
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2013-07-12 17:03:43 |
By :
joolawan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|