Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import MySQLdb
- import sys
- import types
- import time
- print("Welcome to Terzo's Reg Program!")
- time.sleep(1)
- userName = str(input("Enter the account name you want to use: "))
- myEmail = str(input("Enter the email you would like to use: "))
- myQuestion = str(input("Enter your secret question: "))
- idNumber = str(input("Enter an ID number: "))
- myPassword = str(input("Enter your password: "))
- myPassworda = str(input("Enter your password again: "))
- if myPassword == myPassworda:
- print("Your info is :")
- print("Name: ", userName)
- print("Email: ", myEmail)
- print("Question: ", myQuestion)
- print("ID Number", idNumber)
- print("Password: ", myPassword)
- else:
- print("Passwords did not match!")
- sys.exit()
- db = MySQLdb.connect(host="localhost", port=3306, user="root", passwd="test", db="account_zf")
- cursor = db.cursor()
- sql = """INSERT into account(name, email, phone, idnumber, password)
- VALUES (userName, myEmail, myQuestion, idNumber, myPassword)"""
- try:
- cursor.execute(sql)
- db.commit()
- print("Your account has been created!")
- except:
- db.rollback()
- print("Account was not created cause you fail D:")
- db.close()
Add Comment
Please, Sign In to add comment