title: SQLite Insert Statement with C++
body: <p>Below is the code I have tried on a test2.cpp</p>
  
  <p>I checked my database and found out no new record had been added. What actually went wrong in my statement?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sqlite3.h&gt;
  
  //g++ -o test2 test2.cpp -lsqlite3
  using namespace std;
  
  int main()
  {
  int counter = 0;
  
      sqlite3 *db;
      sqlite3_stmt * stmt;
  
  string username = "panda";
  string name = "Kungfu Panda";
  string department = "normal";
  string password = "hellopassword";
  
  string sqlstatement = "INSERT INTO abe_account (" + username + "," + name + "," + department + "," + password + ");";
  
      if (sqlite3_open("abeserver.db", &amp;db) == SQLITE_OK)
      {
      sqlite3_prepare( db, sqlstatement.c_str(), -1, &amp;stmt, NULL );//preparing the statement
      sqlite3_step( stmt );//executing the statement
          }
      else
      {
          cout &lt;&lt; "Failed to open db\n";
      }
  
      sqlite3_finalize(stmt);
      sqlite3_close(db);
  
  
      return 0;
  
  }
  </code></pre>
  
  <p>I would like to ask if it's possible to know if the statement is executed with success too. Like one row added, some form of confirmation from sqlite3. And if there's an error, will it be able to cout out too?</p>