I have the following table in my database:
create table tt (
id varchar(20),
hora varchar(20),
preco varchar(20),
qtde varchar(20),
cpa varchar(20),
vda varchar(20),
agressor varchar(20)
);
I put them all like varchar (30) because my head was too white with the mistakes they were making.
even with all fields like varchar (30) I am not able to insert into the following 7 values via python
19928 12:53:34 4.049,00 5 107 308 Comprador
(19928, "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 ':53:34, 4.049,00, 5, 107, 308, Comprador)' at line 1")
my command to insert into is the following:
c.execute("INSERT INTO tt VALUES ({}, {}, {}, {}, {}, {}, {})".format(id_, hora, preco, qtde, cpa, vda, agressor))
conn.commit()
could also assist me in what types of variables to use to create the table? (int, varchar (20), float)?