title: QT5 and SQLite3 "No query Unable to fetch row"
body: <p>i have a problem with my SQLite Database in QT5. I have table called "mytable" and im trying to save, change or load data there. The table looks like this (CODE):</p>
  
  <pre><code>"mytable" ("id" INTEGER PRIMARY KEY  NOT NULL , "name" VARCHAR NOT NULL , "akcie" INTEGER NOT NULL )
  </code></pre>
  
  <p>Then im trying to work with this database like this (CODE):</p>
  
  <pre><code>void MainWindow::on_pushButton_save_clicked()
  {
      QString jmeno, IDcko, ak;
  
      IDcko = ui-&gt;lineEdit_ID-&gt;text();
      jmeno = ui-&gt;lineEdit_Name-&gt;text();
      ak = ui-&gt;lineEdit_Akcie-&gt;text();
  
      open_connection();
  
      QSqlQuery query;
      query.prepare("INSERT INTO mytable(id, name, akcie) VALUES(id= \'"+ IDcko +"\', name= \'"+ jmeno +"\', akcie= \'"+ ak +"\')");
  
      if(query.exec())
      {
          QMessageBox::information(this, tr("SAVED"), tr("Some text."));
          close_connection();
      }
      else
      {
          QMessageBox::critical(this, tr("NOT SAVED"), query.lastError().text());
          qDebug() &lt;&lt; query.lastError().text();
      }
  }
  </code></pre>
  
  <p>In the same file im opening connection like this (CODE):</p>
  
  <pre><code>bool MainWindow::open_connection()
  {
      QSqlDatabase database;
      database = QSqlDatabase::addDatabase("QSQLITE");
      database.setDatabaseName("‪..\\added\\test_table.sqlite");
      if(!database.open())
      {
          qDebug() &lt;&lt; "not opened connection";
          return false;
      }
      else
      {
          qDebug() &lt;&lt; "opened connection";
          return true;
      }
  }
  </code></pre>
  
  <p>And im still getting error: "No query Unable to fetch row", i have been looking for the answer really hard but nothing worked. Could it be because of some includes or am I doing something wrong?</p>
  
  <p>Thank you in advance for your help!</p>