cursor.fetchall()使用MySQldb和python返回额外的字符

cursor.fetchall()使用MySQldb和python返回额外的字符

当我使用python从SQL数据库中获取结果时,我会在返回值的开头和结尾处获得额外的章程.例如,下面的代码返回((56L,),而不是56,是否有人知道如何获得值……以及((,),)实际意味着什么……?hp= 56 id= 3 database = MySQLdb.connect (host=localhost, user = r

TypeError:’int’对象不可迭代 – Python

TypeError:’int’对象不可迭代 – Python

我收到以下错误: File /home/ec2-user/test/test_stats.py, line 43, in get_test_ids_for_id cursor.execute(select test_id from test_logs where id = %s , (id)) File /home/ec2-u