The Little Guy Posted October 2, 2007 Share Posted October 2, 2007 how would I add some regular expressions to this? SELECT phrase,count, MATCH(phrase) AGAINST ('$q' IN BOOLEAN MODE) AS score FROM keyWords WHERE MATCH(phrase) AGAINST ('$q' IN BOOLEAN MODE) AND phrase != '$q' ORDER BY score DESC, count DESC LIMIT 15 I had the following, but it doesn't work. SELECT phrase,count, MATCH(phrase) AGAINST ('$q' IN BOOLEAN MODE) AS score FROM keyWords WHERE MATCH(phrase) AGAINST (REGEXP '$q[a-zA-Z]{0,5}[0-9]{0,5}' IN BOOLEAN MODE) AND phrase != '$q' ORDER BY score DESC, count DESC LIMIT 15 The error: #1064 - 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 'REGEXP 'free[a-zA-Z]{0,5}[0-9]{0,5}' IN BOOLEAN MODE) AND phrase != '$q' ' at line 3 Quote Link to comment Share on other sites More sharing options...
fenway Posted October 3, 2007 Share Posted October 3, 2007 That's likely because REGEXP need a lvalue of expr. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.