View Single Post
Old 10-25-2021, 10:48 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,128
REGEXP not working right?

This is what I am using:

Quote:
SELECT * FROM Recipe WHERE Category REGEXP '/(?=.*?(seafood))(?=.*?(lunch))/is' ORDER BY RAND() LIMIT 5;");
I want it to display the results for rows that contain both the words (any cAsE) 'seafood' AND 'lunch' in the Category column, it doesnt like my expression though for some reason, any pointers please?

I was under the impression i could use the following to do what I wanted:

Quote:
SELECT * FROM Recipe WHERE Category REGEXP '(?=.*seafood)(?=.*lunch)' ORDER BY RAND() LIMIT 5;");
But it doesnt seem to like that either
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote