0% found this document useful (0 votes)
11 views

Final Book Store

computer science

Uploaded by

sahaana.23.k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Final Book Store

computer science

Uploaded by

sahaana.23.k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

print("**********************************************Welcome To Book

Store***************************************************")

import mysql.connector as M

con=M.connect(host='localhost', user='root', passwd='123456', database='BOOK_STORE')

cur=con.cursor()

while 1:

a=int(input("Enter as Employee: 1\nEnter as User: 2\nExit : 3\nEnter : "))

if a==1:

Staff()

if a==3:

break

if a==2:

print('''''****************BOOK SHOP*********************

1. Signup

2. login''')

s=int(input("Enter Your Choice: "))

if s==1:

user_name=input("Enter Your Username: ")

password=input("Enter Your Password: ")

cur.execute("INSERT INTO SIGNUP VALUES('"+user_name+"','"+password+"')")

cur.execute("COMMIT")

print("Sign Up Completed")

else:

user2= input("Enter Your Username: ")

cur.execute("SELECT USERNAME FROM SIGNUP WHERE USERNAME='"+user2+"'")


b=cur.fetchone()

b1=input("Enter Your Password: ")

cur.execute("SELECT PASSWORD FROM SIGNUP WHERE PASSWORD='"+b1+"'")

a2=cur.fetchone()

if a2 is not None:

print("************************Login Success********************")

Buyer()

You might also like