You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MySQLdb doesn't actually do parameterized queries, but simply quietly escapes and interpolates the passed-in values behind the scenes. This means that under certain (encoding) circumstances, it could be vulnerable to SQL injection.
oursql has actual parameterization, and should probably be recommended for MySQL instead.
The text was updated successfully, but these errors were encountered:
It is effectively the same as the MySQLdb module API-wise (they are both DB-API compliant), they just work differently in the background. oursql speaks the binary protocol (allowing for actual parameterization), whereas MySQLdb escapes the parameters and interpolates (presumably using the older protocol). The example therefore shouldn't really need changing.
That being said, it does use a different parameter style from MySQLdb:
>>> import oursql; print oursql.paramstyle
qmark
Thus the last sentence probably also needs changing.
MySQLdb doesn't actually do parameterized queries, but simply quietly escapes and interpolates the passed-in values behind the scenes. This means that under certain (encoding) circumstances, it could be vulnerable to SQL injection.
oursql has actual parameterization, and should probably be recommended for MySQL instead.
The text was updated successfully, but these errors were encountered: