Sorry, last code is incorrect. The below code is copy-pastable to produce the error for me.
import oursql
host = '127.0.0.1' port = 3303 user = 'test' pw = 'test' db = 'test'
database = oursql.connect(host=host, user=user, passwd=pw, db=db, port=port)
print "SQL Connection Established on %s:%s" % (host, port)
cursor = database.cursor()
cursor.execute("""SELECT * FROM `item_db`""");
rows = cursor.fetchall()
for row in rows: print row
Sorry, last code is incorrect. The below code is copy-pastable to produce the error for me.
import oursql
host = '127.0.0.1'
port = 3303
user = 'test'
pw = 'test'
db = 'test'
database = oursql. connect( host=host, user=user, passwd=pw, db=db, port=port)
print "SQL Connection Established on %s:%s" % (host, port)
cursor = database.cursor()
cursor. execute( """SELECT * FROM `item_db`""");
rows = cursor.fetchall()
for row in rows:
print row