|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
RE: Search in 4 tables at once..
When using multiple tables you specify what table the column is in. (example: table.column)
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
RE: Search in 4 tables at once..
Yeah something like that.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Search in 4 tables at once.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|