I have been trying to make a small catalog for my website. I really don't know where I've gone wrong here, either with my code or the way I have my MySQL database set up. I really hope someone can help. Here is the bit of code that is bothering me.
I see the following when brought up:
Warning: Undefined index: item_image in C:\Inetpub\ on line 32
Warning: Undefined index: item_desc in C:\Inetpub\ on line 32
Warning: Undefined index: item_name in C:\Inetpub\ on line 32
Warning: Undefined index: ebay_href in C:\Inetpub\ on line 32
Warning: Undefined index: item_ebay in C:\Inetpub\ on line 32
What can I do to get this up and running? .:TUCK:.
Code:
<?php
mysql_select_db("store",$db);
$result = mysql_query("SELECT * FROM catalog WHERE item_view = '1'",$db);
if (!$result) {
echo mysql_error();
exit;
}
?>
<!-- SQL Query results -->
<?php
if ($myrow = mysql_fetch_array($result)) {?>
<table border="1" cellpadding="0" cellspacing="0" summary="Query Results" align="center">
<?php
do {
printf("<tr><td><img src=\"%s\"></td><td>%s</tr><tr><td align=\"center\">%s</td><td align=\"center\"><a href=\"%s\"><img src=\"%s\" width=\"60\" height=\"30\"> Go to Ebay Item</a></td></tr>\n", $myrow["item_image"], $myrow["item_desc"], $myrow["item_name"], $myrow["ebay_href"], $myrow["item_ebay"]);
}
while ($myrow = mysql_fetch_row($result));
?>
<tr><td colspan="2" align="center"><a href="#top">Return to Top</a></td></tr>
</table>
<?php }
else{
echo "<center>There are no items for sale presently.</center>";
echo "<center><a href=\"#top\">Return to Top</a></center>";
}
?>
Warning: Undefined index: item_image in C:\Inetpub\ on line 32
Warning: Undefined index: item_desc in C:\Inetpub\ on line 32
Warning: Undefined index: item_name in C:\Inetpub\ on line 32
Warning: Undefined index: ebay_href in C:\Inetpub\ on line 32
Warning: Undefined index: item_ebay in C:\Inetpub\ on line 32
What can I do to get this up and running? .:TUCK:.