Qt Code:
  1. int row;
  2. open conn...
  3. QSqlQuery qry;
  4. qry.prepare("select rowid from my_table");
  5. qry.exec();
  6. while(qry.next()){
  7. if(something==something2)
  8. row=qry.value(0).toInt();
  9. }
  10. close conn...
  11. QString some;
  12. open conn...
  13. qry.prepare("UPDATE my_table"
  14. "SET some=:some"
  15. "WHERE rowid=:row");
  16.  
  17. qry.bindValue(":some", some);
  18. qry.bindValue(":row",row);
  19.  
  20. if(qry.exec()){
  21.  
  22. ...
  23. close conn...
  24. }
  25.  
  26. else{
  27. QMessageBox::critical(this,tr("error::"),qry.lastError().text());
  28. close conn...
  29. }
To copy to clipboard, switch view to plain text mode 

i rly don't understand what am i doing wrong...
note that my sql connections are working fine, ...

i keep getting error "no query unable to fetch row"

Thanks