php - i want to split data from database into three columns of table -
php - i want to split data from database into three columns of table -
i want split info database 3 columns of table don't how have tried it's not working please help me in advance
<?php $count=1; $query1=mysql_query(" select *,category.id ids category inner bring together products on category.`cid`=products.`cid` category.id='$id' ") or die ('product query problem'); while($row1=mysql_fetch_array($query1)) { $count++; ?>
i want split info database 3 columns of table don't how have tried it's not working please help me in advance
<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>
you find clear illustration of creating html table php here. re-create few relevant lines:
if(mysql_num_rows($result2)) { echo '<table cellpadding="0" cellspacing="0" class="db-table">'; echo '<tr><th>field</th><th>type</th><th>null</th><th>key</th><th>default<th>extra</th></tr>'; while($row2 = mysql_fetch_row($result2)) { echo '<tr>'; foreach($row2 $key=>$value) { echo '<td>',$value,'</td>'; } echo '</tr>'; } echo '</table><br />'; }
it echoing columns in table - if want different can alter inner foreach
loop. hope helps!
php mysql
Comments
Post a Comment