I'm just going to include my whole "shopping.php" page code so you know where I'm coming from.
<!DOCTYPE html>
<html>
<head><title>Shopping Page</title>
<style type="text/css">
</style>
<script type="text/javascript">
</script>
</head>
<body>
<form name="form1">
<?php
if (isset($_GET['cat'])) $cat=$_GET['cat'];
else $cat = "fx";
echo $cat;
//1. Make a connection to the database
$dbconn = mysqli_connect("localhost","root","","mydatabase1")
or die(mysqli_connect_error());
$sql = "select productid,name,imagefile "
."from products "
."where categoryid='$cat'";
echo $sql;
//2. Run a query against the database
$result = mysqli_query($dbconn,$sql)
or die(mysqli_error($dbconn));
...and this is the part where I want the results returned as a 3 column table:
//3. Return the results
while ($row = mysqli_fetch_row($result))
{
echo "<a href='order.php?prod=$row[0]'>$row[1]</a><br>";
echo "<img src='images/products/$row[2]' "
."height=200px width =175px><br>";
}
//4. Release the resources
mysqli_free_result($result);
//5. Close the connection
mysqli_close($dbconn);
?>
</form>
</body>
</html>
Right now I get the results but it's just listed vertically. I tried a few different ways but I guess my noobness is getting the best of me. Any help would be greatly appreciated. Thanks.