Hi, I am trying to output the results of my query into a table using a while loop but I am having trouble with it because I cant figure out which bits I need in my <?php ?> braces. Can you help me please?
<html>
<body>
<?php
// This page will list all of the items
// from the items table. Each item will have
// a link to add it to the cart
include("db.php"
;
// Get a connection to the database
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$query = "SELECT * FROM movie ORDER BY Movie_Title ASC";
$result = mysql_query($query);
?>
<?php
//For each item, we output its name, price, genre, and a link to add it to that users shopping cart:
while($row = mysql_fetch_array($result))
{
?>
<table>
<tr>
<td width="30%" height="25">
<font face="verdana" size="1" color="black">
<?php echo $row["Movie_Title"]; ?>
</font>
</td>
<td width="10%" height="25">
<font face="verdana" size="1" color="black">
£<?php echo $row["DVD_Price"]; ?>
</font>
</td>
<td width="50%" height="25">
<font face="verdana" size="1" color="black">
<?php echo $row["Genre"]; ?>
</font>
</td>
<td width="10%" height="25">
<font face="verdana" size="1" color="black">
<a href="cart.php?action=add_item&id=<?php echo $row["itemId"]; ?>&qty=1">Add Item</a>
</font>
</td>
</tr>
<tr>
<td width="100%" colspan="4">
<hr size="1" color="red" NOSHADE>
</td>
</tr>
<tr>
<td width="100%" colspan="4">
<font face="verdana" size="1" color="black">
<a href="cart.php">Your Shopping Cart >></a>
</font>
</td>
</tr>
</table>
</body>
</html>