Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql query returning multiple rows

Status
Not open for further replies.

yahoo182

Programmer
Jul 5, 2005
70
CA
Hi there I have the follwoing code that runs a query on my database
Code:
while ( $row = mysql_fetch_array($images) ) {
echo '<image>';
echo'<Name>'.$row['Name'].'</Name>';
echo'<Caption>'.$row['Caption'].'</Caption>';
echo'<URL>'.$row['URL'].'</URL>';
echo'<Supplier>'.$row['Supplier'].'</Supplier>';
echo'<Width>'.$row['Width'].'</Width>';
echo'<Height>'.$row['Height'].'</Height>';
echo'<ByteSize>'.$row['ByteSize'].'</ByteSize>';
echo'<ThumbnailURL>'.$row['ThumbnailURL'].'</ThumbnailURL>';
echo '</image>';
}

The problem I am having is that $row returns more than one row/record from the database but the code only prints the first record. What I am trying to do is to print all records that was returned to $row
 
What does the code above this look like? Your query?

Ken
 
Hey Ken,
Thanks for the reply again, But it was my database that was corrupted.
The PHP code was working just fine.

Thanks for the quick reply!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top