Hi all,
I was wondering if anyone could suggest a solution to the following?
Here is sthe code:
<?
$db_list = mysql_list_dbs($db);
while ($row = mysql_fetch_object($db_list)) {
if (preg_match("/pm_data_/i", $row->Database)) {
mysql_select_db($row->Database);
$query_test = mysql_query("SELECT pm_message_title FROM pm_messages ORDER BY pm_message_title DESC");
while ($row = mysql_fetch_array($query_test)) {
echo $row['pm_message_title'] . "<BR>";
}
}
}
?>
At the moment this is getting all the databases whose name contains part of the value "pm_data_".
All the databases that match that value have the same tables and table structures.
It then proceeds to do a query where it gets the values for the pm_message_title column. This all works fine but i want to order the output by pm_message_title.
When i try and ORDER BY it orders the results by the database in which it came from....i want to be able to order all the results irrespective of which database they came from.
Any ideas on how to do this, that is if you are able to do this at all?
Cheers,
macca