Posted before in the wrong forum.
Although I am pretty good with HTML and a little javascript, I have a problem using php which I know nothing about.
I'm trying to insert an html table which displays info from an mysql database . . . product info as well as two hrefs, a thumbnail image which enlarges in a new window when clicked (scripted in webpage) and an add to basket link. I'm not sure if I can do either of these from the database.

(Newbie to php and mysql)
I'm doing this mostly so that all changes can be made from the product database (by someone who knows nothing about HTML or Javascript) without having to alter web pages.
I tried searching the web for examples and apply that to my situation, but nothing shows up on my webpage.
Here is the code as it exists now. Is this rubbish or can it be fixed?
<table border="0" cellspacing="2" cellpadding="2">
<?
$username="MyName";
$password="MyPassword";
$database="MyProducts";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM MyProducts";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$Category=mysql_result($result,$i,"Category");
$ItemID=mysql_result($result,$i,"ItemID");
$Desc=mysql_result($result,$i,"Desc");
$Price=mysql_result($result,$i,"Price");
$Thumb=mysql_result($result,$i,"Thumb");
$query="SELECT * FROM PoshEtc WHERE Category='Dresses'";
$result=mysql_query($query);
?>
<tr>
<td><? echo $Thumb; ?></td>
<td><? echo $ItemID; ?></td>
<td><? echo $Desc; ?></td>
<td><? echo "$" $Price; ?></td>
<td><? echo $AddLink; ?></td>
</tr>
<?
$i++;
}
echo "</table>";
Thanks a bunch,
Carol