swto, try:
PHP Code:
$sql="
SELECT
*
FROM
table_1
WHERE
MATCH(column) AGAINST('$keyword1*' IN BOOLEAN MODE)
UNION
SELECT
*
FROM
table_2 WHERE MATCH(column) AGAINST('$keyword2*' IN BOOLEAN MODE)";
$result = mysqli_query($link,$sql);
@Rudy, just reading though the OP again, I think it's a PHP error and not a MySQL error. In the OP the first part of the query (starting with the ' that marks the start of it) was:
PHP Code:
'SELECT * FROM table_1 WHERE MATCH(column) AGAINST('$keyword1*' IN BOOLEAN MODE)
Now as soon as PHP reaches the first unescaped ' it assumes that it has reached the end of the query string and so is not expecting to find the $keyword, it was expecting to find a )
The OP could instead have used " at the start and end of the query string.
Bookmarks