I have a MySQLvariable
@query = CONCAT('INSERT INTO history VALUES (',1,',',50,',UTC_TIMESTAMP()');
I want to execute the insert statement present in the variable.
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 first prepare the statement using
PREPAREand then useEXECUTESee here: http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-prepared-statements.html
Something like: