我有这段代码:
ip = "127.0.0.1"
sql = "select count(*) from radacct where nasipaddress=%s"
cur.execute(sql,ip)
但是我遇到了一个错误,类似于:
TypeError: not all arguments converted during string formatting
我该如何以正确的方式将参数传递给psycopg2?
我有这段代码:
ip = "127.0.0.1"
sql = "select count(*) from radacct where nasipaddress=%s"
cur.execute(sql,ip)
但是我遇到了一个错误,类似于:
TypeError: not all arguments converted during string formatting
我该如何以正确的方式将参数传递给psycopg2?