how to add users data in sqllite3 python

PHOTO EMBED

Tue Jul 09 2024 07:40:48 GMT+0000 (Coordinated Universal Time)

Saved by @freepythoncode ##python #coding #python #programming #sqllite3 #database

import sqlite3

# Connect to the database
con = sqlite3.connect('database.db')

# Create a cursor object
cursor = con.cursor()

# Create a cursor object
cursor = con.cursor()

# Insert a new user
cursor.execute("INSERT INTO users (name, email) VALUES (?, ?)", ("John Doe", "johndoe@example.com"))

# Commit the changes
con.commit()

content_copyCOPY