This is my regular code and it works fine:
$sql = 'SELECT '
. '* '
. 'FROM '
. 'item '
. 'WHERE MATCH '
. '(title) '
. 'AGAINST '
. '(:search IN NATURAL LANGUAGE MODE) '
. 'OR MATCH '
. '(description) '
. 'AGAINST '
. '(:search IN NATURAL LANGUAGE MODE) '
. 'ORDER BY '
. 'id ASC';
I want to compare the field "status" to the string "public" because I need only the "public" entrys, I tried something like this:
$sql = 'SELECT '
. '* '
. 'FROM '
. 'item '
. 'WHERE MATCH '
. '(title) '
. 'AGAINST '
. '(:search IN NATURAL LANGUAGE MODE) '
. 'OR MATCH '
. '(description) '
. 'AGAINST '
. '(:search IN NATURAL LANGUAGE MODE) '
. 'WHERE '
. 'status = "public" '
. 'ORDER BY '
. 'id ASC';
But with the last "WHERE" the result is nothing I expected.
Is there any solution?