I have a variable $word and I’d like to match it in my select statement
somethig like this: “select * from table where column regex ‘[0-9]$word'”
but this doesnt work, so how can i put a variable in a regular exprssion?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You must only put it correctly in SQL query, for example:
But you need to remember that the variable data needs to be properly escaped, i think that addslashes() would be enough.