当我试图上传PlayerScore
和代码时
if Number.PlayerScore > Score.interact_database("SELECT Score FROM score WHERE Name = %s;" % Player_Name, False,)[0][0]
对于Python中的PostgreSQL数据库,我得到以下错误:psycopg2.ProgrammingError: column "your name" does not exist
,其中'your name'是变量Player\u name。但是,当我在PostgreSQL查询工具中运行它时,它工作得很好。有人知道为什么会出现这样的错误吗?我怎样才能防止它在将来再次发生?在
http://initd.org/psycopg/docs/usage.html#the-problem-with-the-query-parameters
我想我们需要更多的代码,但是根据文档:
尝试将参数作为光标.执行()方法。使用类似于:
应该行得通。它还可以接受值的元组。在
相关问题 更多 >
编程相关推荐