FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Multiple Table Searches





moejoe
Hi,

Does anyone know how to use MYSQL to search more than one table?

I've heard of UNION but i cant get it to work.

All of my tables have similar to identical columns.

thanks.
moejoe
Figured it OUT for anyone who needs this in formation:

EXAMPLE CODE:
Code:
<? $SQL ="SELECT * FROM table 1
UNION ALL
SELECT * FROM Table 2";
?>


UNION all will show any Duplicated entries with the two table combined.

If you dont want the duplications Simply use UNION!

Thanks!
Related topics
Opera 9.0 Technology Preview 2
Rank High For MULTIPLE phrases
Search whole database
What are your Firefox extensions
All About WoW
AJAX tutorial [2nd part now updated]
CREATE INDEX
Authentication Module
Phrases I hate. Add your own if you want.
mysql database table structure
How to combine lots of queries to one - MySQL
I'm having problems understanding keys
Help me writing this query. Urgent
Creating Table in HTML
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.