Jump to content

ewaite

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ewaite's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi cssfreakie, Thanks for the help, I have Google search foreach loop an looked at examples, but I still don't understand how to get my data from the fields into the loops. Were does a person go to learn this stuff? It is very hard to learn from books. Thanks, ewaite
  2. 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
  3. Hi All, 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> Thanks, ewaite
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.