> This is most definitely a quoting issue with your PHP string. If it is
> quoted correctly, the MySQL server will never see the string $var
> appearing after the keyword REGEXP, so if $ has meaning to a regular
> expression wouldn't matter (unless the value of $var contained a $).
> I've used REGEXP with (really complex) dynamicly built regular
> expressions stored in PHP variables a number of times and have never had
> a problem as you've described above.
MySQL is not seeing $var, but it is seeing var from what I can understand of
Regexp (the manual on this is not very good), $ means to match the end of a
string, so since I have $var, I am thinking that Regexp thinks that the end
of the string I want to search for ends with var. In any event, the actual
value of $var never gets sent to MySQL, so the search will always fail.
Maybe I am misunderstanding the meaning of this, but since I really can't
make any sense out of the manual, I am guessing at what I think they mean.
Let me give you and example:
$var=One ($var is passed the string from a form on a webpage)
There are 3 entries in the database with the word One
That's the One
There are also other words that contain the word one, like stone and anyone.
I want to be able to run a search that will just show the first 3 by typing
in the word One ('one' would result in the string not found').