Jump to content

Echo Question


Pandareen

Recommended Posts

well, i have 3 tables, let's say cars, houses and cats( with no relations between them ), and i want to echo data from them ( name, pic and info ) in 3 diferent tables from my webpage ( 1 for cars, 1 for houses and 1 for cats )

 

so yes, i want 3 separate tables over 3 separate querrys.It can be done?

Link to comment
Share on other sites

rough psuedo-code...

connect to db
$query1 = "SELECT pic, name, from cars";
$query2 = "SELECT picture, firstname, from houses";
$query3 = "SELECT pic, name, color  from cats";

$result1 = mysql_query($query1);
$result2 = mysql_query($query2);
$result3 = mysql_query($query3);

while($row1 = mysql_fetch_array($result1) {
  echo $row1['pic'] . " - " . $row1['name'] . "<br/>";
}
echo "<hr>";

while($row2 = mysql_fetch_array($result2) {
  echo $row2['picture'] . " - " . $row1['firstname'] . "<br/>";
}

echo "<hr>";
while($row3 = mysql_fetch_array($result3) {
  echo $row1['pic'] . " - " . $row1['name'] . $row3['color'] . "<br/>";
}

 

Link to comment
Share on other sites

well, i have 3 tables, let's say cars, houses and cats( with no relations between them ), and i want to echo data from them ( name, pic and info ) in 3 diferent tables from my webpage ( 1 for cars, 1 for houses and 1 for cats )

 

so yes, i want 3 separate tables over 3 separate querrys.It can be done?

Your lack of attempt leads me to believe that you have not done any research.  We are not here to do your work for you.  We already said it was possible and there are probably thousands of examples on this site alone.  People will be more willing to help if you actually try first ;)

 

If you provide us with the appropriate information and maybe some code you've tried, we'll be able to help you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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