while($row = mysql_fetch_array($result)) { $id = $row["ID"]; echo "<tr><td><a href='prueba2.php?id=".$id."'><img src='images/image.png.png' border='0'></a></td></tr>" ; }