Protected from MySQL injection.

Used the MySQLdb built in features with cursor.execute() to escape any
command line input before running queries.