define vars before SQL statement

This commit is contained in:
Jonathan Ervine 2020-12-11 09:55:29 +08:00
parent 0ad23e9be4
commit ec7ff3e3e1

View File

@ -33,10 +33,11 @@ def convenorAddClub():
@routes.route('/convenor/clubAddResult', methods=['POST'])
def convenorAddClubResult():
club_lookup = "SELECT club FROM _clubTeams WHERE club='" + _club + "' GROUP BY club"
club_create = "INSERT INTO _clubTeams (club, team) VALUES ('" + _club + "', 'A')"
try:
_club = request.form['clubName']
club_lookup = "SELECT club FROM _clubTeams WHERE club='" + _club + "' GROUP BY club"
club_create = "INSERT INTO _clubTeams (club, team) VALUES ('" + _club + "', 'A')"
# validate that this data has been entered
if _club and request.method == 'POST':
clubExist = sql_read(club_lookup)