I am building a Mysql Full Text Search, I have 4 tables to search. when I use only single table in search query it works, but when i use multiple tables in query it doesn't work. also I dont want to use UNION ALL in query cause i am using check box select option to perform search in individual or multiple tables.
MySQL Query on multiple table not working.
$sqlquery = mysql_query("(SELECT * FROM table1, table2, table3, table4 WHERE MATCH (pflink, title) AGAINST ('%$keyword*%' IN BOOLEAN MODE) )ORDER by pflink desc, $orderby $sortby LIMIT $rowsperpage OFFSET $offset ")or die (mysql_error());
It gives me error Column 'pflink' in where clause is ambiguous
Using single table Query works.
$sqlquery = mysql_query("(SELECT * FROM table1 WHERE MATCH (pflink, title) AGAINST ('%$keyword*%' IN BOOLEAN MODE) )ORDER by pflink desc, $orderby $sortby LIMIT $rowsperpage OFFSET $offset ")or die (mysql_error());
Html Checkbox codes
<input name="all-tables" type="checkbox" value="true" checked="checked" id="check-all" >
<input name="table1" type="checkbox" value="true" disabled="disabled" >
<input name="table2" type="checkbox" value="true" disabled="disabled" >
<input name="table3" type="checkbox" value="true" disabled="disabled" >
<input name="table4" type="checkbox" value="true" disabled="disabled" >
Please suggest any possible way to modify this query to make it work for multiple tables.
Thanks.