Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase 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 Codewalkers Forums Sponsor:
  #1  
Old July 6th, 2003, 09:06 AM
DaveO DaveO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 DaveO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to DaveO
Search in 4 tables at once..

Hi,

I'm currently new in MySQL and have a question. I have a database with 4 tables. I use this query for a fulltext search, like:

$query = "select * from table1, table2, tabele3, table4 where MATCH(title,body) AGAINST ("%$squery%" in BOOLEAN MODE)";

This script need to search voor a keyword in title, body, but not only in one table, but all of them. This error appears when I'm trying to execute the query:

MySQL returned:
Column: 'title' in where clause is ambiguous

Hmzz, I've been trying to solve this problem for two days now, and still nog be able to resolve it. Can somebody please help me out?


Reply With Quote
  #2  
Old July 6th, 2003, 02:30 PM
sliver's Avatar
sliver sliver is offline
Moderator
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: WI, USA
Posts: 906 sliver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 18 m 35 sec
Reputation Power: 2
Send a message via AIM to sliver Send a message via XFire to sliver
RE: Search in 4 tables at once..

When using multiple tables you specify what table the column is in. (example: table.column)

Reply With Quote
  #3  
Old July 6th, 2003, 03:10 PM
DaveO DaveO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 DaveO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to DaveO
RE: Search in 4 tables at once..

" When using multiple tables you specify what table the column is in. (example: table.column"

So I tested the following:

$query = "select * from table1, table2, tabele3, table4 where MATCH(table1.title,table1.body) AGAINST ("%$squery%" in BOOLEAN MODE)";

Now I get 128 hits, and all of them are the same...something like a loop? What am I doing wrong? Do I need to specify something like:


$query = "select * from table1, table2, tabele3, table4 where MATCH(table1.title,table2.title,table2.title,table 1.body) AGAINST ("%$squery%" in BOOLEAN MODE)";

? thanks!

Dave

Reply With Quote
  #4  
Old July 6th, 2003, 09:03 PM
sliver's Avatar
sliver sliver is offline
Moderator
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: WI, USA
Posts: 906 sliver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 18 m 35 sec
Reputation Power: 2
Send a message via AIM to sliver Send a message via XFire to sliver
RE: Search in 4 tables at once..

Yeah something like that.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Search in 4 tables at once..


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 3 hosted by Hostway
Stay green...Green IT