Advertisement
Guest User

Untitled

a guest
Dec 31st, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import mysql.connector
  2.  
  3. mydb = mysql.connector.connect(
  4. host = "localhost",
  5. user = "perivxup_perisic",
  6. password = "BkJxt-DseH~N",
  7. database = "perivxup_lowes"
  8. )
  9.  
  10. mycursor = mydb.cursor()
  11.  
  12. sql_formula = "INSERT INTO proba (ID, broj) VALUES (NULL, 1);"
  13. mycursor.execute(sql_formula)
  14. mydb.commit()
  15.  
  16. sql_formula = "INSERT INTO proba (ID, broj) VALUES (NULL, 2);"
  17. mycursor.execute(sql_formula)
  18. mydb.commit()
  19.  
  20. sql_formula = "INSERT INTO proba (ID, broj) VALUES (NULL, 3);"
  21. mycursor.execute(sql_formula)
  22. mydb.commit()
  23.  
  24. sql_formula = "INSERT INTO proba (ID, broj) VALUES (NULL, 4);"
  25. mycursor.execute(sql_formula)
  26. mydb.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement