I am not sure what exactly you mean.  If you are talking about a regular 
query then:
        SELECT tblTable1.hits, tblTable2.hits FROM tblTable1, tblTable2 ORDER BY 

If you are talking about combining the two tables so that all your 'hits' 
are in one column then there are a few ways to skin that cute little 
kitten (in order of difficulty):
        1) Check to see if your databae supports UNION clauses. 
        2) If not, make a table with the data from the first table then append the 
data from the second table.  Then query for your combined results and 
delete the table from the database.  You may run into problems if more than 
one person tries to do this at a time, so be careful.
        3) Or. create an array using data from the first set then loop through the 
second set adding the data from the second set.  Then sort.

Good luck and keep us posted.


Georgie Casey wrote:

> i assume this is a simple question...
> how can I SELECT * FROM 2 different tables in the same query, ORDER BYing
> the 'hits' column, which both tables have.
> eg, 2 tables i have are similiar and i want to merge them and then select
> everything ordering by hits

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to