Advertisement
Guest User

Untitled

a guest
Aug 4th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. "Not all parameters where used in the SQL statement".
  2.  
  3. import mysql.connector
  4. con=mysql.connector.connect(user="root",password="",host="127.0.0.1",database="bdpython")
  5. cursor=con.cursor()
  6. #DATOS
  7. id=1
  8. nombre="juan"
  9. cursor.execute("INSERT INTO ejemplo (id,datos) VALUES(?,?)",(id,nombre,))
  10. con.commit()
  11. con.close()
  12.  
  13. cursor.execute("INSERT INTO ejemplo (id) VALUES(?)",(id,))
  14. cursor.execute("INSERT INTO ejemplo (datos) VALUES(?)",(nombre,))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement