当前位置:网站首页>How to insert data into MySQL database- How can I insert data into a MySQL database?

How to insert data into MySQL database- How can I insert data into a MySQL database?

2022-07-05 23:22:00 Rich in starch

problem :

I want to insert the integers 188 and 90 in my MySQL database, but the following code doesn't work: I want to be in my MySQL Insert an integer into the database 188 and 90, But the following code doesn't work :

import MySQLdbconn = MySQLdb.connect(host= "localhost",                  user="root",                  passwd="newpassword",                  db="engy1")x = conn.cursor()x.execute("SELECT *  FROM anooog1")x.execute (" INSERT INTO anooog1 VALUES ('%s','%s') ", (188,90))row = x.fetchall()

Why doesn't it work? Why doesn't it work ?


Solution :

Reference resources : https://stackoom.com/en/question/NrdO
原网站

版权声明
本文为[Rich in starch]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140328316605.html