Problems inserting a datatime record

1

This is the description of my table in MySQL

That'showI'mcrackingthelogs

insertintopedido(data_criacao,data_entrega,entrega_cep,entrega_cidade,entrega_logradouro,entrega_numero,entrega_uf,forma_pagamento,status,valor_desconto,valor_frete,valor_total,cliente_id,vendedor_id)values(2013-08-1711:25:00,2013-08-20,34400000,"Uberlandia","Rua das arvores grandes",300,"MG","DINHEIRO","ORCAMENTO",0.00,0.00,1000.00,1,1);

This is the error that is appearing in the table;

The error is on line 6, how do I correctly insert the record;

    
asked by anonymous 31.05.2015 / 17:38

1 answer

3

Values date, datetime, timestamp as well as text (char, varchar, text etc) need to be enclosed in quotation marks, preferably simple ones, depending on the server configuration double quotes can also be used to identify table names, columns and other database objects, this setting is known as ansi quotes .

insert into pedido
(data_criacao,
data_entrega,
entrega_cep,
entrega_cidade,entrega_logradouro,entrega_numero,entrega_uf,
forma_pagamento,status,
valor_desconto,
valor_frete,
valor_total,
cliente_id,vendedor_id)
values
('2013-08-17 11:25:00',
'2013-08-20',
34400000,
'Uberlandia',
'Rua das arvores grandes',
300,
'MG',
'DINHEIRO',
'ORCAMENTO',
0.00,
0.00,
1000.00,
1,
1);
    
31.05.2015 / 17:45