SELECT FROM ALL TABLES
| From: | Bruce Levick | Date: | Fri, 18 Apr 2003 13:52:04 +0000 |
| Subject: | SELECT FROM ALL TABLES | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27165@lists.php.net to get a copy of this message | ||
Hi Guys,
Am having a little trouble with selecting a certain piece of data from all
tables and then displaying the results.
I have 5 tables (Concepts, Illustrations, ID, Photos, Misc). All tables have
a column named (itemMonth). Which is simply a month of the year (any month).
I am trying to display the results of a SELECT query where itemMonth =
'April'. But can't for the life of me get the results from all the tables to
display from one SELECT query.
So for example the display might look something like this.
Here are all the new works from April (Concepts, Illustrations, ID, Photos,
Misc)
Concepts 1
Concepts 2
Concepts 3
Illustraion 1
ID 1
Photos 1
Misc 1
Misc 2
There could be any number of results from either of the tables. Obviously
only after results where itemMonth = 'April'.
I have tried many combinations to get this to work. I don't think the
solution is to produce a select query for each table, that seems a bit code
heavy.
Sorry if I am missing something obvious....am a little tired.
Bruce