Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector
- mydb = mysql.connector.connect(
- host="localhost",
- user="root",
- password="",
- database="WebApp_DB"
- )
- myc = mydb.cursor()
- sql_formula = 'INSERT INTO korisnik (ID, name) VALUES (NULL, %s);'
- myc.execute(sql_formula, (name,))
- mydb.commit()
- mydb.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement