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
You must only put it correctly in SQL query, for example:
mysql_query("SELECT * FROM table WHERE column REGEXP 'prefix_".$word."'");
But you need to remember that the variable data needs to be properly escaped, i think that addslashes() would be enough.