Thread: table searching

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

    Join Date
    Mar 2000
    Posts
    13
    Rep Power
    0
    how do you search multiple tables? i have 3 tables and i want to search for a certain name, and the name may be in either of the 3 tables, i also want to return similiar names as the one being looked for. That is, if someone looks for tom then it will look in all three tables returning the results for tom, tommy, tom1, tom2, etc.

    thanks in advance...
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    You'll have to query each table seperately.

    As far as searching for a column that would contain all variations:

    select * from tbl_name where clmn_name LIKE '%$search_term%'

    This will return records that contain the search term in clmn_name at any location. '$search_term%' will return if the search term STARTS the field.

    HTH

Similar Threads

  1. How do I Generate Access 200 Db from script?
    By johnnyr77 in forum Database Management
    Replies: 0
    Last Post: September 1st, 2003, 05:45 PM
  2. Soccer League table
    By silverduck in forum Database Management
    Replies: 3
    Last Post: August 19th, 2003, 04:46 AM
  3. searching more than one table using fulltext
    By buttie in forum MySQL Help
    Replies: 8
    Last Post: May 6th, 2003, 02:28 AM
  4. searching more than one table
    By buttie in forum Database Management
    Replies: 1
    Last Post: December 24th, 2002, 08:45 AM
  5. help on 3 table join query?
    By smakz in forum Database Management
    Replies: 1
    Last Post: November 19th, 2002, 04:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo