title: Qt - QSql Unable to fetch row, no query on attempt to insert
body: <p>I'm trying to insert data into a table. Here's the code:</p>
  
  <pre><code>void AddContacts::saveContact() {
  
      QString first_name = ui-&gt;lineFirstName-&gt;text();
      QString last_name = ui-&gt;lineLastName-&gt;text();
      QString street_address = ui-&gt;lineStreetAddress-&gt;text();
      QString city = ui-&gt;lineCity-&gt;text();
      QString state = ui-&gt;comboBoxState-&gt;currentText();
      QString zip_code = ui-&gt;lineZip-&gt;text();
      QString personal_email = ui-&gt;linePersonalEmail-&gt;text();
      QString work_email = ui-&gt;lineWorkEmail-&gt;text();
      QString home_phone = ui-&gt;lineHomePhone-&gt;text();
      QString cellular_phone = ui-&gt;lineCellularPhone-&gt;text();
      QString work_phone = ui-&gt;lineWorkPhone-&gt;text();
      QString pager = ui-&gt;linePager-&gt;text();
      QString facebook = ui-&gt;lineFacebook-&gt;text();
      QString twitter = ui-&gt;lineTwitter-&gt;text();
      QString notes = ui-&gt;textEditNotes-&gt;toPlainText();
  
      // Insert into the database
      QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
      db.setDatabaseName("db.db3");
      db.open();
  
      QSqlQuery qry;
      QString query = "INSERT INTO (id, first_name, last_name, street_address, city, state, zip_code, personal_email, work_email, home_phone, cellular_phone, work_phone, pager, facebook, twitter, notes) VALUES('null','" + first_name + "','" + last_name +"','" + street_address + "','" + city + "','" + state + "','" + zip_code + "','" + personal_email + "','" + work_email + "','" + home_phone + "','" + cellular_phone + "','" + work_phone + "','" + pager + "','" + facebook + "','" + twitter + "', '" + notes + "')";
      qry.prepare(query);
  
      if(!qry.exec()) {
          qDebug() &lt;&lt; qry.lastError();
      }
      else {
          qDebug() &lt;&lt; "Success!";
      }
  </code></pre>
  
  <p>Here is what I used to create the table:</p>
  
  <pre><code>CREATE TABLE contacts (
  id int primary key,
  first_name varchar(20),
  last_name varchar(20),
  street_address text,
  city varchar(30),
  state varchar(20),
  zip_code varchar(10),
  personal_email varchar(40),
  work_email varchar(40),
  home_phone varchar(12),
  cellular_phone varchar(12),
  work_phone varchar(12),
  pager varchar(12),
  facebook text,
  twitter varchar(20),
  notes text);
  </code></pre>
  
  <p>I'm getting this error: </p>
  
  <blockquote>
    <p>QSqlError(-1, "Unable to fetch row", "No query")</p>
  </blockquote>
  
  <p>I'm not sure what I could be doing wrong. Can you find anything?</p>