So let's say if I want to display results from a single mysql table, the code is simple and looks something like this: <?php $data = mysql_query("SELECT * FROM video_comments ORDER BY id DESC LIMIT 5"); while($row = mysql_fetch_array($data)) { echo " ".$row[text]." "; } ?> PHP: But what if I want to agreggate data from several mysql tables and display them in a single results window? Any idea on how to do this? Many thanks in advance
Do you literally mean what you posted? Display stuff from table 1, then stuff from table 2, then from table 3, all in the same page? The answer seems so obvious that it's painful to give it. Or do you mean interspersing the data from different tables based on some overarching sort criteria? In that case, you could combine the data in your SQL query or in PHP. Which one is more efficient depends on what your tables are like. More information is needed to answer that question.
By creating 2 mysql queries ? Sometimes it's better to turn on your brains rather than posting silly questions
I think he meant databases. If so, you're going to have to select a database, execute query, select the second database, execute query, and so on.
could you not make do a JOIN 3 tables to the left of each other creating one big table then query it ??