Quote:
Originally Posted by Sane
Firstly: Refer to my very first reply in this thread. Does your code begin with, and follow, that template?
Secondly: Does the code at least compile in your local Python interpreter?
Thirdly: Please wrap your code in [code][/code] tags next time.
Fourthly: Your code does not even have a single print statement. How do you expect it to make visible output? Do you even know how to program in Python?
|
Ok so according to you ,i should test this :
#!c:/python24/python
import cgitb
import cgi
cgitb.enable()
print "Content-type: text/html\r"
print "\r"
class Eb_db:
def __init__(self):
try:
connection = MySQLdb.connect(host="localhost",
user="swan", passwd="swan", db="swan" )
cursor = connection.cursor()
cursor.execute( "SELECT * FROM Table1 " )
except MySQLdb.OperationalError, message:
errorMessage = "Error %d:\n%s" % (message[ 0 ], message[ 1 ] )
return
else:
self.data = cursor.fetchall()
self.fields = cursor.description
cursor.close()
connection.close()
I agree, i am new to python, but i know php, and can run the same program in php.
Yah ! the code doesnot output anything, but atleast doesnot give any error when a similar program is made in php.