Flask, not all arguments converted during string formatting

十年热恋 提交于 2019-12-06 02:36:55

Just converting my earlier comment to an answer, as it seemed to be the right solution :-)

The problem is coming from a different line. You have this:

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

This doesn't do what you might think it does. Putting email in brackets does nothing, so the line is actually equivalent to passing in each character of whatever's in that variable in a list of characters. If instead you do this:

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

...then you'll be passing in a tuple containing one item, email, and it should work better.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!