View Single Post
Old 30-06-2004, 14:10   #3 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,206
OK here's some more example code. Like I say, this works but I need to limit the results. Any help appreciated.

Code:
$tables = array('boys', 'girls'); $names = array(); $order = array(); foreach ($tables as $table) { $result = mysql_query('SELECT id, name, created FROM ' . $table); while ($row = mysql_fetch_assoc($result)) { $names[$table . '_' . $row['id']] = array('name' => $row['name'], 'table' => $table); $order[$table . '_' . $row['id']] = $row['created']; } } asort($order) foreach ($order as $id => $created) { printf('<a href="%s/%2$s.html">%s</a>', $names[$id]['table'], $names[$id]['name']); }
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote