为什么我得到了uid的值
在调试控制台和使用时
<input id="userId" name="userId" type="text" value= {{ un[usernumber][0] }} >
但在与一起使用时会出现错误mysql.connection.cursor目录() ? 你知道吗
请帮我弄清楚为什么会发生这种情况并解决它。你知道吗
cur = mysql.connection.cursor()
cur.execute(
"UPDATE User SET email='" +
form.email.data +
"', phone='" +
form.phone.data +
"', mphone='" +
form.mphone.data +
"', status='" +
form.status.data +
#"' WHERE userId='12' ") # ok
"' WHERE userId='" + uid + "' ")
# TypeError: int() argument must be a string or a number,
# not 'NoneType'
# and IOError: [Errno 32] Broken pipe
rv = cur.fetchall()
mysql.connection.commit()
return 'ok'
调试控制台:
对,我们得到了所需的价值
* Restarting with stat
* Debugger is active!
* Debugger pin code: ...-...-...
uid: 2
127.0.0.1 - - [09/Jun/2016 17:20:28] "GET /edit?i=1 HTTP/1.1" 200 -
你不能这样做。参见Little Jonny Tables了解原因。你知道吗
请使用dbapi的工具来阻止这样的攻击。除了安全性的好处之外,您的代码也因此变得更简单、更容易理解。你知道吗
相关问题 更多 >
编程相关推荐