-1
import mysql.connector
mysql.connection = mysql.connector.connect(host='localhost',
user='root',
password='rgs050601',
database='testegr')
sql = "INSERT INTO pet (id,numero,idade) VALUES %s"
pd = "(5,6,1),(9,8,1),(7,5,9)"
cursor = mysql.connection.cursor()
cursor.execute(sql,(pd,))
mysql.connection.commit()
this is not my original code I only made as a very simple test base wanted to insert the values of pd directly in the query but without using the executemany or concatenate the values in the string above that would be the one of the query
Thanks for the help, the first method I think would be impractical for me, but the second with format I n had still thought it might be right , n knew that could work with the format within the parameters there, but helped mto
– Renan Sacca