Multiple images...

wxdqz

New Member
G'day:

I'm using php4.0.3/MySQL3.22.32/Apache

I wish to display multiple images from a DB.

I am able to display a single image based on a users selection, but the table in the DB contains more than one image for each category, but the script refues to obey me!

$sql = " SELECT * FROM $table_name WHERE category = '$id' ";
$result = @mysql_query($sql, $connection) or die("Died at sql query");
while ($row = mysql_fetch_array($result)) {
$category = $row['category'];
$image = $row['image'];

$display_this = "
<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\">
<tr>
<td>
<table border=\"0\" cellpadding=\"2\" cellspacing=\"5\"
<tr> ";

//Display each image related to each sport in the database for this category

$display_this .= " <td><a href=http://www.phpbuilder.com/board/archive/index.php/\"sport.php\">$image</a></td> ";

//Complete end-tags for background and nested tables

$display_this .= "
</tr>
</table>
</td>
</table>
";

Like I said I can get ONE image to display, but not the rest for the same category.

Anyone else come across anything similar (I have searched the archives, but nothing seems to be specific to this..)

Cheers:
Russ
 
Back
Top