it displays empty page. any help please
#!c:/python25/python
import MySQLdb as mdb
import sys
# Import modules for CGI handling
import cgi, cgitb
print "Content-type:text/html\r\n\r\n"
try:
conn = mdb.connect(host='localhost',user='mabel',
passwd='mabel10', db='test')
cursor = conn.cursor()
cursor.execute("SELECT pic FROM Images where Id=8")
fout = open('baby3.jpeg','wb')
fout.write(cursor.fetchone()[0])
fout.close()
cursor.close()
conn.close()
except IOError, e:
print "Error %d: %s" % (Data)(e.args[0],e.args[1])
sys.exit(1)


Sign In
Create Account

Back to top









