For my final I need to make a website including a shopping cart and all....
I am at the stage where I need to make the product selections using mysql. Anyway I'm having problems displaying the certain information on the page, this is done by clicking on the link and then clicking on the image to select the product that the user wants to purchase. Anyway.....when I select on the link for products it gives me the proper information but added information on the bottom, that supposed to show up on the product page......
you can see what I'm talking about here
Please HELP!!!!!
this is my code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Product Selection</title>
</head>
<body background="zertxtr.gif" text="#FFFFFF" topmargin="0" bottommargin="0" link="#C0C0C0" vlink="#C0C0C0" alink="#C0C0C0" background="background.jpg">
<?php
@ $db = mysql_connect("web6.duc.auburn.edu", "Lorzadp", "ladytiger");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("sqlInventorydatabase42");
$query = "select * from product";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
if ($prochoice =="$prochoice")
{
$query = "select * from product
where categoryid = '$prochoice'";
$result=mysql_query($query);
echo "<table border=5>";
for ($i = 0; $i <4 ; $i++)
{
$row = mysql_fetch_array($result);
echo"<TR>";
echo"<TH> </TH> <TH>Product Name</TH> <TH>Price</TH><TH>Catgory ID</TH>";
echo"</TR>";
echo"<TR>";
echo"<td>".$row[6]."</td>"; echo"<td>".$row[1]."</td>";
echo"<td>".$row[3]."</td>";echo"<td>".$row[5]."</td>";
echo"</TR>";
}
echo"</TABLE>";
}
if ($proid =="$proid")
{
$query = "select * from product
where protid ='$proid'";
$result = mysql_query($query);
}
{
$row = mysql_fetch_array($result);
?>
<p align="middle"> <?php echo".$row[7]."; ?></p>
<table width="300" border="1">
<tr>
<td width="135"> Product: <?php echo"$row[1]"; ?></td>
</tr>
<tr>
<td>Description: <?php echo"$row[2]"; ?></td>
</tr>
<tr>
<td>Price: $<?php echo"$row[3]"; ?></td>
</tr>
<tr>
<td>Quantity Available: <?php echo"$row[4]"; ?></td>
</tr>
<tr>
<td>Category: <?php echo"$row[5]"; ?></td>
</tr>
<tr>
<td><input type = "submit" value = "Click to Buy"></td>
</tr>
</table>
<?php
}
?>
</body>
</html>