Just wondering if anyone can give me a hand with sassy php for every loop ...
I currently have a table of products that I selected for the table, each with 75% hr> then, but I would like it to become a table with three columns. I do not mind if, for example, in the product table there are 4 products, and in the first column and in the next 2 - empty, etc.
Current code as below ...
<?php if($results && mysql_num_rows($results) > 0){ ?> <?php $i = 1; while($row = mysql_fetch_assoc($results)){ $i++; ?><table width="750"> <tr> <td id="topbottom" width="220px"><a href="products.php?id=<?php echo($row['productId']); ?>"/><img src="images/<?php echo($row['imageName']); ?>" width="220px"/></a></td> <td id="pad"> <h1><?php echo($row['productName']); ?></h1> <br> <h2><?php echo($row['productType']); ?></h2> <br> <h3> £<?php echo($row['productPrice']); ?></h3> <br> <?php echo($row['productDesc']); ?> <br /><br /> <a href="products.php?id=<?php echo($row['productId']); ?>"/><img src="images/findout.png"/></a> </td> </tr></table><hr color="#6c3600" width="75%" /> <?php } ?> <?php } else { echo("<p>No items found</p>"); } ?>
source share