Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQLdb._escape_string() broken in Python 2.7 #1

Open
spizeck opened this issue Mar 17, 2016 · 0 comments
Open

MySQLdb._escape_string() broken in Python 2.7 #1

spizeck opened this issue Mar 17, 2016 · 0 comments

Comments

@spizeck
Copy link

spizeck commented Mar 17, 2016

I was having a bunch of trouble getting the registration page to work and someone on stackoverflow (http://stackoverflow.com/questions/3617052/escape-string-python-for-mysql) suggested an alternate way after I found a bunch of posts relating to the escape_string currently being broken. I edited __init__.py registration page with the following and was able to get it to work.

sql_check_reg = "SELECT * FROM users WHERE username = (%s)"
x = c.execute(sql_check_reg, (username,))

and:

sql_insert_reg = "INSERT INTO users (username, password, email) VALUES (%s, %s, %s)"
c.execute(sql_insert_reg, (username, password, email))

Maybe you could verify that this is in fact a good method and not susceptible to sql injection?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant