关于MySQLdb,求大神指点啊,头疼啊
代码是
fileLineText=file_follower_of_original_node.readline()
while(''!=fileLineText):
temp=fileLineText
cur=conn.cursor()
cur.execute("select * from follower_followee where followee_id='%s'",temp) rows=cur.fetchall()
for row in rows:
file_relationships_of_sample_twice.write('%s|%s\n' % (row[0],row[0]))
cur.close()
fileLineText=file_follower_of_original_node.readline()
报错Mysql Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10111\n''' at line 1
如果把红色一行改为cur.execute("select * from follower_followee where followee_id=10029")则可以正常运行
这是什么情况啊?求大神指点
[解决办法]
cur.execute("select * from follower_followee where followee_id='%s'" % temp)