Edge_jr Posted May 21, 2015 Share Posted May 21, 2015 (edited) Hi, I have problem in writing update statement in single quote with php variable having data. If I use single quote then statement do not work,if I use double code then I get error using code sniffer as per PS standards "String " UPDATE `" does not require double quotes; use single quotes instead" if (!Db::getInstance()->Execute(" UPDATE `"._DB_PREFIX_."table` SET column ='$value' ")); /** Working */ if (!Db::getInstance()->Execute(' UPDATE `"._DB_PREFIX_."table` SET column = "'.$value.'" ')) /** Not working */ How to make update statement working with single quote. Please help and advise. -Thanks Edited May 21, 2015 by edge82 (see edit history) Link to comment Share on other sites More sharing options...
presta.show Posted May 22, 2015 Share Posted May 22, 2015 Hi try this: if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'table` SET column =\''.$value.'\' ')); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now