[PHP] Regexp matching in SQL

2006-03-06 Thread Brian Anderson
I am trying to simplify an SQL query that is pretty much like below: $sql = SELECT * FROM table WHERE keyword RLIKE '$expression1' OR keyword RLIKE '$expression2' ; The different terms '$expression1' and '$expression1' come from an array. Is there any way to within one regular expression to

RE: [PHP] Regexp matching in SQL

2006-03-06 Thread jblanchard
[snip] I am trying to simplify an SQL query that is pretty much like below: $sql = SELECT * FROM table WHERE keyword RLIKE '$expression1' OR keyword RLIKE '$expression2' ; The different terms '$expression1' and '$expression1' come from an array. Is there any way to within one regular

Re: [PHP] Regexp matching in SQL

2006-03-06 Thread Brian Anderson
IN ( exp1, exp2) didn't seem to work for me. I've seen that used before for including a subquery, but somehow it didn't like the comma separated list. I think this below is doing it for me. $separated = implode(|, (explode( , (AddSlashes($_REQUEST['terms']);

Re: [PHP] Regexp matching in SQL

2006-03-06 Thread Chris
Brian Anderson wrote: IN ( exp1, exp2) didn't seem to work for me. I've seen that used before for including a subquery, but somehow it didn't like the comma separated list. I think this below is doing it for me. $separated = implode(|, (explode( , (AddSlashes($_REQUEST['terms']);