just trying to take a picture with raspberry pi and inserting actual datetime and picture into mysql db... I've tried to insert just the datetime... thats fine. but I get an error inserting the image...
image = open(picPath+filename, 'r')
pic = image.read()
mysql = MySQLdb.connect(host="local", user="root", passwd="bla", db="sexyimages")
cur = mysql.cursor()
sql = ("insert into test(SampleTime, picture) values(%s, %s)")
cur.execute(sql, (jetzt, pic))
mysql.commit()
Warning: Incorrect integer value: '????c?Exif' for column 'picture' at row 1 cur.execute(sql, (jetzt, pic))
anyone an idea?
oh ya using python-mysqldb
cheeers
'r'
to'rb'
– bernie Nov 14 '14 at 20:03