Skip to content

Instantly share code, notes, and snippets.

@ayancey
Created Feb 14, 2017
Embed
What would you like to do?
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