Skip to content

Tag: syntax-error

Php mysql query update of data gives syntax error

This is my php code to update products in database: It gives this error: Answer This code should work: But a better approach would be to use parameterized prepared statements as you are vulnerable now to SQL injections. Also refer to: https://dev.mysql.com/doc/apis-php/en/apis-php-mysqli.quickstart.prepared-s…

PHP how to use OR in the right way

I have simple part of code to detect type of Discount, i added another type, but how to use operator OR (||) right way in this case ? ->where(‘taken’, “N”) or “R” do something. this wont work ->where(‘taken’, “N” || “R”) Answer in t…