At 18:58 1-4-03, you wrote:
I have two tables that I want to display together as if they were one table
and order them by a common date field.

Because I am using MySQL I can't use the usually way I would do this. Create
a store procedure or view.
Does every row in tableA has a sibling row in tableB and vice versa, and is there some field that could combine them? For instance this date field, is it unique (one entry for every date) ?

If the answer is yes to both:

$query="SELECT title, text, date FROM tableA as A, tableB as B WHERE A.date=B.date ORDER BY date"

Now (AFAIK) if table A has 2 entries on april1 and table B has 3 entries on april1, you would get 2x3=6 resulting rows with all possible combinations.
You could also link with any combination of fieldnames, like
WHERE A.category=B.the_category
WHERE A.category=B.catID


If that does not work for you.... look up the array sort functions. Best also do a search in the webpage from this list (see ww.php.net -> emaillists -> archive), look for array and sort.



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



Reply via email to