Not really sure what to call what I want to do, If I knew I could search for information.
I am building a page with 20 pictures on it with a name below each, I want to pull the Name and image file name from a MySQL database but the names and image file names need to come from 20 different rows. My database key name is Id, so I'm guessing somehow I need to to use something to say: where Id = "var" Below is part of the code I have I can get the same image file and name in all 20 places.
Any help would be great,
<?php require_once('../../Connections/Trophies.php'); ?>
<?php
mysql_select_db($database_Trophies, $Trophies);
$query_gallery = "SELECT Id, image, name FROM trophies WHERE Id >= 1 ORDER BY Id ASC";
$gallery = mysql_query($query_gallery, $Trophies) or die(mysql_error());
$row_gallery = mysql_fetch_assoc($gallery);
$totalRows_gallery = mysql_num_rows($gallery);
?>
<td width="20%" height="150" align="center" valign="middle" bgcolor="#000000"><img src="deer-images/<?php echo $row_gallery['image']; ?>" alt="<?php echo $row_gallery['name']; ?>" width="125" height="187"/><br />
<font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_gallery['name']; ?></font></td>
<td width="20%" align="center" valign="middle" bgcolor="#000000"><img src="deer-images/<?php echo $row_gallery['image']; ?>" alt="<?php echo $row_gallery['name']; ?>" width="125" height="187" /><br />
<font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_gallery['name']; ?></font></td>
<td width="19%" align="center" valign="middle" bgcolor="#000000"><img src="deer-images/<?php echo $row_gallery['image']; ?>" width="125" height="187" /><br />
<font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row_gallery['name']; ?></font></td>
Database Structure:
ID = Primary (auto Increment)
name
image = (just a file name)
score-sheet = (just a file name)
story
score
comp-score
county
state
date
method
catagory
Sorry, Hope this is better,
thanks for any help
ewaite