#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    3
    Rep 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??
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    109
    Rep Power
    15
    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!

Similar Threads

  1. tables get corrupted
    By 90coders in forum MySQL Help
    Replies: 1
    Last Post: December 5th, 2003, 05:23 AM
  2. Site html search with php?
    By stojan in forum PHP Development
    Replies: 1
    Last Post: November 17th, 2003, 09:20 PM
  3. Replies: 2
    Last Post: February 14th, 2002, 05:49 PM
  4. How can I search Multiple Tables???
    By timsharpe in forum MySQL Help
    Replies: 2
    Last Post: June 20th, 2001, 09:59 AM
  5. How can I search multiple tables????
    By timsharpe in forum MySQL Help
    Replies: 0
    Last Post: June 18th, 2001, 07:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo