Originally Posted by saa7_go If you modify your codes to the following: Qt Code: Switch view int ProductsForm::categoryIdByName(const QString& name){ QSqlQuery categories(model->database()); categories.exec(QString("SELECT id FROM Categories WHERE name='%1'").arg(name)); if(categories.size()==-1) { qDebug() << "error"; return 1; } .....} int ProductsForm::categoryIdByName(const QString& name) { QSqlQuery categories(model->database()); categories.exec(QString("SELECT id FROM Categories WHERE name='%1'").arg(name)); if(categories.size()==-1) { qDebug() << "error"; return 1; } ..... } To copy to clipboard, switch view to plain text mode is categories.size() value still -1 ? yesss...
int ProductsForm::categoryIdByName(const QString& name){ QSqlQuery categories(model->database()); categories.exec(QString("SELECT id FROM Categories WHERE name='%1'").arg(name)); if(categories.size()==-1) { qDebug() << "error"; return 1; } .....}
int ProductsForm::categoryIdByName(const QString& name) { QSqlQuery categories(model->database()); categories.exec(QString("SELECT id FROM Categories WHERE name='%1'").arg(name)); if(categories.size()==-1) { qDebug() << "error"; return 1; } ..... }
View Tag Cloud
Forum Rules
Bookmarks