Hi
I have problem with this code..
it does not give me any results.
even if i try to use .size() it want work as will.
query.prepare("SELECT COUNT(*) AS 'numberOfUsers'\n"
" FROM users AS u );
query.exec();
if (!query.isActive())
QMessageBox::warning(this, tr("Database Error"),query.lastError().text());
numberOfPages = query.value(0).toInt();
QSqlQuery query;
query.prepare("SELECT COUNT(*) AS 'numberOfUsers'\n"
" FROM users AS u );
query.exec();
if (!query.isActive())
QMessageBox::warning(this, tr("Database Error"),query.lastError().text());
numberOfPages = query.value(0).toInt();
To copy to clipboard, switch view to plain text mode
I do not want to use the QSqlTableModel as it slew up all the program.
I need fast way to get this COUNT number.
Using Values want work an using Results() did not work as the Handel and .asInt() function in not working as will.
Regards
Bookmarks