I have changed the table name, field name and the number of fetchone field- all verified with the database in MySQL which is: Table: tbl_user Columns: user_id int(11) AI PK user_name varchar(255) user_username varchar(255) user_password varchar(100)
I did the select query from the command line and got the correct row of data.
when I press the login button is get "(2)Invalid credentials, try again." and flash :"not all arguments converted during string formatting "
I had a similar problem in the register section which was remedied by adding the comma after (thwart(username) in the code as seen below: x = c.execute("SELECT * FROM tbl_user WHERE user_username = (%s)", (thwart(username),)) Not sure exactly why that worked but some site recommended it and it worked.
I have tried that in various ways on the code for login ("data = c.execute("SELECT * FROM tbl_user WHERE user_username = (%s)", thwart(request.form['username']))") but no success.
Any guidance is appreciated.
You must be logged in to post. Please login or register an account.