C
C
CrewCut2015-12-22 18:56:17
MySQL
CrewCut, 2015-12-22 18:56:17

What is mysql syntax error?

I work with OpenCart, I insert the phone number into the database by the order number, but an error is returned:
Notice : Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order SET telephone = '1477' WHERE order_id = '12757'' at line 1
Error No: 1064
UPDATE order SET telephone = '1477' WHERE order_id = '12757' in /home/a/admin60/public_html/system/database/mysql.php on line 97
MySQL version - 5.6.24-72.2
Here is the query itself:

$this->db->query("UPDATE order SET telephone = '1477' WHERE order_id = '12757'");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-12-22
@CrewCut

order needs to be escaped, it's a reserved word.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question