Hi there I have a page which currently displays all the product models that are in the database, but they are all displayed in 1 column down the page making it very large in size,
I used a tutorial found on here to help display the products in a 5 coulmn table but since I have added this nifty bit of code in, it doesnt call the product information from the database anymore..
Can someone point out what I have done wrong? or where I am going wrong for this to happen?
Here is my code:
<?php
$Makeid = $_GET['make'];
require('conn.php');
$m = "SELECT image, imagealt, bundleid, make, model, phoneid FROM table WHERE make = '$Makeid' ORDER BY 'model'";
$result = mysql_query($m); // execute query
$count = 0; // initialize counter
echo "<br>";
echo "<table align='center'>";
// initialize table tag, this string will hold the html output table withe all the records
// loop thru the records
while ($row = mysql_fetch_array($result)) {
$count++;
}
echo "<tr>";
for($x=1; $x<=$count; $x++) {
$row = mysql_fetch_array($result);
echo "<td valign='middle'><a href='phone-{$row['phoneid']}.php'><img src='/_images/" .$row['image'] ."' width='33' height='68' alt='".$row['imagealt'] ."' border='0'></a>" .' ' . "<a href='phone-".$row['phoneid'].".php' title='" .$row['make'] .' ' .$row['model']." Mobile Phone'>".$row['make'].' '.$row['model'].":</a>".' '."<script type='text/javascript' src='http://www.phones2udirect.co.uk/_js/bundleprice.asp?BundleID=".$row['bundleid']."'>"."</script>" ."<a href='http://www.phones2udirect.co.uk/shop/action/add/BundleID/".$row['bundleid'] ."' title='Buy Now'>" ."<br>" ."<img src='_images/buy.jpg' border='0' alt='Buy Now'>"."<br>"."<br>" ."</a>". "</td>"; // add fields if necessary
if($x % 5 == 0) {
echo '</tr><tr>';
}
}
echo '</tr></table>';
mysql_close();
echo "<br>";
echo " $count $make product(s) found.";
echo "<br>";
echo "<br>";
?>
Any help would be really helpful, Thanks
Chris