This will display all the rows depending on the query given to mysql
PHP Code:
include_once('mysql.php');
$sql = "SELECT * FROM `table`; ";
$rs = mysql_query($sql, $conn) or die ("error with sql query ".$sql);
while ($row = mysql_fetch_array ($rs)){
$id = $row['id'];
$alt = $row['alt'];
$name = $row['name'];
echo '<img src="getimage.php?id=' . $id . '" alt="' . $alt . '" title="' . $name .'"/> <br />';
}
in this case (SELECT * FROM `table`; ) I said select all (*) from table.
the while loop will just pirnt out all rows until it finds no more.
I wouldn't use ! because if it returns 0 rows that becomes an error.
You don't need to delcare mysql.php twice (I am assuming it contains the connection data, though you should print it here so we can see it)
I am really guessing at what you want, perhaps if you give us some test data and the table name and rows, I could give you a 100% picture.