Will someone PLEASE show me what I'm doing wrong? I'm new to using phpMyAdmin and db.
I have a db table with 4 items. Looks fine on a plain php page - I get all four items in correct order.
But if I use coding <ul class="column"><li><div class="imgblock"> like shown below, I get 4 duplicates of my last entry in the db table. I think I have to rearrange how I use ", ', and ), etc.? Not sure how though...
<?php
// Make a MySQL Connection
mysql_connect("localhost", "....", "....") or die(mysql_error());
mysql_select_db("....") or die(mysql_error());
$show = "SELECT pn, pgname, img, name, price FROM prodshort";
$result = mysql_query ($show);
while ($show = mysql_fetch_array ($result))
{
$field2= $show['pn'];
$field3= $show['pgname'];
$field4= $show['img'];
$field5= $show['name'];
$field6= $show['price'];
$field7= $show['specs'];
}
?>
<!-- start -->
<ul class="column"><li><div class="imgblock">
<a href="<?echo "$field3";?>">
<img src="<?echo "$field4";?>" width="320" height="240" alt="<?echo "$field5";?>" /></a></div><br />
<a href="<?echo "$field3";?>"><?echo "$field5";?></a>
<ul class="specs">
<?echo "$field7";?></ul>
<div class="price">
#<?echo "$field2";?> $<?echo "$field6";?>
</div></li></ul>
<!-- end -->