i have 2 table:

TableA 
Name            Birth
Sandra          Jan 1,1980
Bob             Feb 12,1972


TableB
Name            Birth
Hendra          Jan 4,1950
Joeli           Feb 15,1962

How do i select the oldest 2 people from both table in php???


I've tried:

<?php
 $statement = "(SELECT name FROM TableA)
                UNION
               (SELECT name FROM TableB)
                LIMIT 2 ORDER BY Birth";

 $result = mysql_query($statement);
 while ($row = mysql_fetch_array($result)) echo $row[name];
?>

but it didn't work..
any other solution??
Each table contains about 50.000 records, and i have a perfect good reason
to keep them in a separate table.





The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to