Hi to all!

Here is the code:
Qt Code:
  1. QString queryString("SELECT * from merchandize WHERE GrupaIdentificationNumber=%1;");
  2. //QString queryString("SELECT * from merchandize WHERE GrupaIdentificationNumber=2;"); // test
  3. queryString=queryString.arg(groupId);
  4. qDebug() << "Query: " << queryString; // debug
  5.  
  6. QSqlQuery query(queryString); // sets up query from query string
  7. removeAllMerchandize(); // removes all items
  8. m_iImageCounter=0; // inits counter
  9. //query.exec(queryString); // executes query string
  10. while (query.next())
  11. {
  12. .....
  13. }
To copy to clipboard, switch view to plain text mode 

As you can see, I've debugged created query and it is ok. But why the program flow skips while loop. The database is filled and the application is connected to it as it must be. I thought there is something wrong with query itself, but as I copied quey, which was produces with qDebug() and pasted it into mysql by hand, I got right results. Can someone help me please?