[PyQt] Qt and mysql

Martin Alderete malderete at gmail.com
Thu Aug 23 03:40:53 BST 2007

Hi! I have problems when i try to get values from sql query. I have record
in database but when i do the code below i recived None objects..., I'm
using mysql-server5.0, Qt4.3 and PyQt4.3 ....  Can anybody check it?


Martin Alderete

self.manager = QtSql.QSqlDatabase("QMYSQL")
self.ok = self.manager.open();
string = QtCore.QString( "SELECT * from users")
query = QtSql.QSqlQuery(string, self.manager)
print "result: %s" % query.value(0).toString()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070823/48ab91c2/attachment.html

More information about the PyQt mailing list