Good day everyone, i need to display image from the database but the code returns error page when i tried to print image from the database using
below is the entire codes
Code:
#! /data/python
import MySQLdb
import sys
[
print ("Content-type: image/jpeg");
print # End of headers!
try:
cx = (*********)
cursor = cx.cursor()
cursor.execute("SELECT photo FROM picture LIMIT 1")
fout=cursor.fetchone()[0]
print fout
#fout.close()
#cursor.close()
cx.close()
except IOError, e:
print "Error %d: %s" % (e.args[0],e.args[1])
sys.exit(1)
ANY HELP
Bookmarks