I have coded a class to handle mysql connecting using the external modules but when I get data I want it to be returned like:
{ 'id': '1', 'username': 'Test'}
it's currently returned:
(1, u'Test')
The code which I use is:
def executeQuery(self, query):
if(self.mysqlSuccess):
cursor = self.cnx.cursor()
cursor.execute(query)
for row in cursor:
print row
executeQuery('SELECT * FROM `users`')