Originally Posted by
Evethir
query = QtSql.QSqlQuery(db)
query.exec_("SELECT * FROM userscredentials")
print(query.value(0))
As above, your query is not pointing at a valid record. You don't call query.next() (or first as d_stranz said). If your expecting a single record you can do;
if query.next():
print(query.value(0))
if query.next():
print(query.value(0))
To copy to clipboard, switch view to plain text mode
or for more results use a while loop:
while query.next():
print(query.value(0))
while query.next():
print(query.value(0))
To copy to clipboard, switch view to plain text mode
Bookmarks