i had a query in mysql for just inserting some data
the query is
$insert_query_pur = "INSERT INTO `dbname`.`tblname` (`USER_NAME`,`PURCHASE_TYPE`,`PURCHASE_KEY`, `SUBSCRIPTION_ID`,`PURCHASE_DATE`,`NO_OF_ISSUE`,`MAGAZINE_ID`,`AppsCode`,`PROCESS_STATUS`,`User_price`,`Publisher_price`, `Publisher_price_inr`) VALUES ('$USER_NAME','$PURCHASE_TYPE','$PURCHASE_KEY','$SUBSCRIPTION_ID','$PURCHASE_DATE','$NO_OF_ISSUE','$MAGAZINE_ID','$AppsCode','$PROCESS_STATUS','$User_price','$Publisher_price','$Publisher_price_inr')";
but when i excecute this query i got an error
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/thewinkstore.com/magsonwink/modules/admin/support/classes/support_manage.class.php on line 685
i can’t find what is the issue. please help me
Don’t put all in one line, in situations like these, you might loose the overview too fast.
The recommendation is that you make use of prepared statements for such insert queries so that you do not need to built the SQL string on your own. This is explained in the PHP manual.
For an interim improvement, you might want to first of all distribute the string over multiple lines:
Whitespace and indentation is your friend. I hope this helps even if it does not solve your concrete issue.