SunQuest
           MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 2nd, 2000, 01:05 PM
starspider starspider is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 3 starspider User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

i have a little search engine running. Its one table, i have a couple categories. I realized the categories with simply one field called categorie so i can show all the data in a single categorie by selecting it with the query SELECT * FROM table WHERE categorie = 'categoriename'. This works quite fine. But now i read my new book. Its MySQL and mSQL by OReilly. Its a very great book. According to their database design chapter its better if i would create one table for each categorie. That would be no problem but: How am I gonna search more then one table with one query? Some say I can do this with Joins but i dont know how. Can somebody help me??

Reply With Quote
  #2  
Old May 4th, 2000, 02:52 AM
pwluky pwluky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 109 pwluky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
I haven't tested the follow code but i think that it work!

The query you search:
$query = "SELECT t1.*,t2.*,t3.* FROM table1 as t1, table2 as t2, table3 as t3 WHERE t1.categorie='categoriename' or t2.categorie='categoriename' or t3.categorie='categoriename'";

Please tellme if this statement works! Thanx!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Search a couple tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway