0

Can someone please tell me why this class wont work.

#!/usr/bin/python
import MySQLdb

class test:
     @staticmethod
     def wanker():
         # connect
         db = MySQLdb.connect(host = "localhost", user = "username", passwd = "Password", db = "test")
         # create a database cursor
         cursor = db.cursor(MySQLdb.cursors.DictCursor)

         # execute SQL select statement
         cursor.execute("SELECT * FROM Threshold")

         Results = cursor.fetchall()
         return Results
        

x = test()
adam =  x.wanker()
print adam

nothing is returned :(

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by adam291086
0

******() is not allowed as a function name. A function name has to start with a letter or an underscore and can contain numbers.

0

they are not ***** its because the function is a naught word that has been blocked out by the forum

0

i have tried a normal name as well and still nothing. I have no idea and its rather annoying

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.