Skip to content

Instantly share code, notes, and snippets.

@ayancey
Created February 14, 2017 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayancey/98b9652bfca321ead29cf3116d9a3a29 to your computer and use it in GitHub Desktop.
Save ayancey/98b9652bfca321ead29cf3116d9a3a29 to your computer and use it in GitHub Desktop.
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