I have this string ($query) returning from preg_replace
'SELECT ({$array["sum"]}/ 5)'
how can i evaluate it, so that the result would be 'SELECT (100/5)' for example !
I tried
eval($query)
But with no success!
Do you have a better idea ?
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’re not using eval right:
take care you do not have any syntax errors. also you just might do it wrong when you build SQL queries this way. Just saying, I hope you’re old enough.