Unsolved QSqlQuery next()
-
Pls how next() return always true?
QSqlQuery query; query.prepare("SELECT firstName FROM employee WHERE name = ?"); query.bindValue("MyName"); query.exec();
query next ist allways true. Table is empty
if (query.next()) { QString firstName = query.value(0).toString(); // this work without fail // firstName is NULL; }
is there an other way to find out if we got one ore more records?
[edit: koahnig. Code tags added]
-
-
thx
I't seem this issue is only when i debug the code, when i put a qDebug in the lines and run my app i can see that next() will return false. confused
-
@ckvsoft which Qt version and compiler do you use?