PythonAPI传输数据到MySQL出现报错:Invalid JSON text: The document root must not be followed by other values

错误代码:

cursor.execute(
        'SELECT * FROM table_code where code=%s',(code)
    ) 

正确代码:

cursor.execute(
        'SELECT * FROM table_code where code=%s',(code,)
    ) 

猜你喜欢

转载自blog.csdn.net/weixin_46479909/article/details/132282641