1
votes

why this will make an error?

$this->db->where('MATCH (title) AGAINST ("stackoverflow")', NULL, TRUE);

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AGAINST ("stackoverflow") LIMIT 4' at line 3

SELECT * FROM (table) WHERE MATCH (title) AGAINST ("stackoverflow") LIMIT 4

when change to FALSE,the query will ok,but i want to protect mytable with with backticks

1
Can you post the whole active record method used? it might be your select method! - ifaour

1 Answers

0
votes

Standard SQL uses single quotes, not double quotes.

MATCH (title) AGAINST ('stackoverflow')

You can test whether this is really the problem with a string as your WHERE clause.

$where = "MATCH (title) AGAINST ('stackoverflow') LIMIT 4";
$this->db->where($where);