A
A
Alexander Vladimirovich2018-04-29 12:53:27
symfony
Alexander Vladimirovich, 2018-04-29 12:53:27

How to insert rows into order table?

Good afternoon!
I'm making a simple store on symfony 4, the task is to put an order in the order table. Can't insert, throws an error

An exception occurred while executing 'INSERT INTO order (sum) VALUES (?)' with params ["0.00"]:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order (sum) VALUES ('0.00')' at line 1

here is the table structure
CREATE TABLE `order` (
    id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    sum decimal(20, 2) UNSIGNED DEFAULT 0.00,
    PRIMARY KEY (id)
)
ENGINE = INNODB
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-04-30
@polyanin

Reserved words must be enclosed in quotation marks

/**
 * @ORM\Table(name="`order`")
 */
class Order {}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question