I have a listProducts.php page that querys a table in my phpMyAdmin database. It takes the information and puts it out onto the page using a while loop. Here is the code:

PHP Code:
<?php 
include("db.inc.php"); 

$db=open_db("test");
$sql="Select image, name, description, price from ss02_products";
$result=query_db($sql);
?>

<table summary="">
<tr>
<th></th><th>Name</th><th>Description</th><th>Price</th>
</tr>
<?php while($row get_row_array($result)){ ?>
<tr>
<td><a href="productInfo.php"><img alt="<? echo $row['name'];?>" src="<? echo $row['image'];?>" width="200" height="200"/></a></td>
<td><a href="productInfo.php"><? echo $row['name'];?></a></td>
<td><? echo $row['description'];?> </td>
<td>$<? echo $row['price'];?> </td>
</tr>
<?php ?>
</table>
My question is this: How do I pass a value to another PHP page that way I can have it dynamically bring up just that product info, instead of putting them all on the page. Its kinda like a link to a more detail product info page.

I was thinking that I need some sort of count variable that I incrememnt each time through the loop that corresponds to the productID in my phpMyAdmin table. How would I pass this variable to another PHP page which will then use it in an SQL statement that will get the info for that productID from the table in the Database. How would I put it into an HREF tag to send it to that page?

Something like

<a href="productInfo.php?index=<?php echo $i++ ?>" > Some product<a/>

What do you think? SHould i do it this way or should I possible try something with Smarty or a Session or cookie?

Thanks for the help.