Quote Originally Posted by Evethir View Post
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;

Qt Code:
  1. if query.next():
  2. print(query.value(0))
To copy to clipboard, switch view to plain text mode 

or for more results use a while loop:

Qt Code:
  1. while query.next():
  2. print(query.value(0))
To copy to clipboard, switch view to plain text mode