I have the following code in my save function.

Qt Code:
  1. void smith::on_saveButton_clicked()
  2. {
  3.  
  4. QSqlQuery query;
  5.  
  6. query.prepare(
  7. "INSERT INTO application (firstname, lastname, country, city)) "
  8. "VALUES (:firstname, :lastname, :country, :city)"
  9. );
  10.  
  11. query.bindValue(":firstname", "Alexis");
  12. query.bindValue(":lastname", "Nicholov");
  13. query.bindValue(":country", "Russia");
  14. query.bindValue(":city","Moscow");
  15. query.exec();
  16. }
To copy to clipboard, switch view to plain text mode 

The database connection is alright but it wont insert.Why?.