Created
February 14, 2017 23:03
-
-
Save ayancey/98b9652bfca321ead29cf3116d9a3a29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import records | |
db = records.Database('mysql://root:a6478a14@172.16.144.157/bank') | |
print('Welcome to the Softbank registration system!') | |
print('Please tell us the following information...') | |
first_name = raw_input('First name: ') | |
middle_name = raw_input('Middle name: ') | |
last_name = raw_input('Last name: ') | |
username = first_name.lower()[0] + last_name.lower() | |
email = raw_input('Email: ') | |
password = raw_input('Password: ') | |
enabled = "1" | |
# Always sanitize user input before executing SQL, this is just an example | |
db.query("INSERT INTO user VALUES (NULL, '" + first_name + "', '" + middle_name + "', '" + last_name + | |
"', '" + username + "', '" + email + "', '" + password + "', '" + enabled + "');") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment