I'm trying to debug some code I inherited from another team, to whom I have no access.
The code 开发者_如何学Pythonis generating the following query:
SELECT blah FROM missing_table
WHERE ...
AND MATCH ('@identity PROFILE @security 0|10000060')
GROUP BY document_id ORDER BY posted DESC LIMIT 0, 5
Note the lack of an "AGAINST" clause.
This query is generating the following error:
ERROR 1064 (42000): 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 ''@identity PROFILE @security 0|10000060')
A couple of odd things here:
1) The table (I've changed the name to "missing_table" here to protect the innocent) doesn't show up when I do a "desc" or "show tables".
2) There is no "AGAINST" clause in the query.
Any clues about what might be going on here would be greatly appreciated!
You only said clues, so a little unclear on what I would do if I couldn't find the table definition at least , if not the data. but here's an example of a working query that I use to search across three columns; MM, address1, and city , in maintable.
(I thought you had to comma separate everything, but seeing more and more beginners getting away with murder and it working with mysql statements.
$sql = "SELECT * FROM `maintable` where `type` = '" . $ptyp . "' AND MATCH(MM, address1, city) AGAINST('" . $one . "*' IN BOOLEAN MODE) LIMIT " . $pagelimit. ", 20";
精彩评论