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
https://forums.phpfreaks.com/topic/254351-echo-question/#findComment-1304225
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
https://forums.phpfreaks.com/topic/254351-echo-question/#findComment-1304242
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
https://forums.phpfreaks.com/topic/254351-echo-question/#findComment-1304260
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.