Jump to content

Update statement not working with single quotes and with double quotes gives error as use single quo


Edge_jr

Recommended Posts

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 by edge82 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...