Jump to content

REGEXP


The Little Guy

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/71579-regexp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.