Jump to content

Echoing everything from the Database


dean7

Recommended Posts

hi all, I have a piece of code which I coded where it selects all there cars out of the database and shows them, well it is meant to:

 

$getall = mysql_query("SELECT car, id FROM garage WHERE owner='$username'");
$gotall = mysql_fetch_object($getall);

echo "$gotall->car  - $gotall->id<br />";

 

Its meant to echo out all the cars which the user own, but for some reason its only echoing one car.

 

Can anyone see why its only showing one car with the id not all the cars they own?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/210740-echoing-everything-from-the-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.