我想将数据库中的数据拆分为表的三列,但我不知道该怎么做我已经尝试过,但它不能正常工作请帮助我提前谢谢
<?php
$count=1;
$query1=mysql_query(" SELECT *,category.id ids FROM category INNER JOIN products ON category.`cid`=products.`cid` WHERE category.id='$id' ") or die ('Product Query Problem');
while($row1=mysql_fetch_array($query1))
{
$count++;
?>
我想将数据库中的数据拆分为表的三列,但我不知道该怎么做我已经尝试过,但它不能正常工作请帮助我提前谢谢
<div class="main_content">
<div class="featured-items clearfix">
<div class="items clearfix">
<table border="0">
<tr>
<td><div class="item-block-1">
<div class="image-wrapper">
<div class="image">
<div class="overlay">
<div class="position">
<div>
<p><?php echo $row1['description']; ?></p>
<a href="pandora-homepage.html#" class="quickshop">Quick shop</a>
</div>
</div>
</div>
<a href=""><img src="products/images/photos/photo-2.jpg" style="margin: -27.5px 0 0 0;" alt="" /></a>
</div>
</div>
<h2><a href=""><?php echo $row1['product']; ?></a></h2>
<p class="price"><?php echo $row1['price']; ?></p>
</div>
<?php
if($count%3==1)
{
?></td></tr>
</table>
<?php }}?>
</div>
</div>
</div>