question

Penolopei avatar image
Penolopei asked

MySQL #1064 error

Mysql shows me the following error when trying to make a query Code: INSERT INTO order SET `status` = "1", `item_id` = "2", `model` = "Arenda", `author` = "sdff", `phone` = "646645", `email` = "r@ gmail.com" Error: #1064 - 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 `status` = "1", `item_id` = "2", `model` = "Arenda", `author` = "ÐлÐ' at line 1 What`s the problem? on other hosts everything works fine
mysqlerror
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@SQLShark avatar image
@SQLShark answered
I have not used MySQL for a while but that is just invalid SQL. INSERT INTO Order (OrderID, OrderDate) VALUES ( 121, '20150101') UPDATE Order SET OrderDate = '20150102' WHERE OrderID = 121 You are mixing the two statements. You cannot SET something that has not been inserted yet.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Outrageous avatar image
Outrageous answered
and on the other hostings such request also should not work - you mixed up syntax INSERT with syntax UPDATE, as SQLShark already said. If you want to insert a new data into the table, you should write something like this: INSERT INTO table(field1, field2, ..., fieldn) VALUES ("value1", "value2", ..., "valuen"); If you want to update the data, then it will be: UPDATE table SET field1="value1" [WHERE ...] Also read this discussion: [ http://www.filerepairforum.com/forum/databases/databases-aa/mysql/1818-corrupt-myisam-tables-in-mysql-4-5][1] [1]: http://www.filerepairforum.com/forum/databases/databases-aa/mysql/1818-corrupt-myisam-tables-in-mysql-4-5
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.