CS Project
CS Project
USE gst_billing_system;
def create_connection():
return mysql.connector.connect(
host="localhost",
user="your_username",
password="your_password",
database="gst_billing_system"
)
LOGIN MODULE
def login(username, password):
conn = create_connection()
cursor = conn.cursor()
cursor.execute("SELECT * FROM users WHERE username = %s", (username,))
user = cursor.fetchone()
def delete_inventory(item_id):
conn = create_connection()
cursor = conn.cursor()
cursor.execute("DELETE FROM inventory WHERE item_id = %s", (item_id,))
conn.commit()
print("Item deleted from inventory.")
cursor.close()
conn.close()