Home > other >  The execute parameters in pymysql type problems
The execute parameters in pymysql type problems

Time:03-12

Database definition table is like this:
` id ` int the NOT NULL AUTO_INCREMENT,
` name ` varchar (40) NOT NULL,
` remark ` varchar (1000), NULL,
` isBuy ` int (1) the DEFAULT 1,
` version ` int (11), NOT null default 1000,

Add code:
-- -- -- -- --
SQL="insert into the product (name, remark, isBuy, version) values (% s, % s, % s, % s) '
Params=(' ladle temperature ', 'steel logistics system', '1', '122')
Um. The cursor. The execute (SQL, params)
-- -- -- -- --
It was possible, but:
-- -- -- -- --
SQL="insert into the product (name, remark, isBuy, version) values (% s, % s, % d, % d) '
Params=(' ladle temperature ', 'steel logistics system, 1, 122)
Um. The cursor. The execute (SQL, params)
-- -- -- -- --
This is no good?
Why define table clearly when the int and incoming parameters when do string format to write in it?
  • Related