[thelist] PHP MySQL quotes variable question

Mark Gillingham markgill at uwalumni.com
Sun Sep 26 18:14:48 CDT 2004

I want to change a query that I have been using for some time--I know 
that much of it works. The essence is that I am getting two form 
variables, one for state and one for item, and returning them to a class 
that searches my database. All is well if the returned variables from 
the form are in single quotes (e.g., '$return_state' or 
'$returned_item'). I want to match only the last few characters of the 
$returned_item variable and have tried the following without success:

RLIKE '$returned_item$'
RLIKE "$returned_item$"
RLIKE "{$returned_item}$" 

As long as certain conditions are met about the returned value, the 
following work:

LIKE '$returned_item%'
RLIKE '$returne_item'

There must be something special about double-quotes and regular 
expressions when searching the db. Any ideas? tia


More information about the thelist mailing list