title: UPDATE statement in sqlite3 (using C++ interface) does not actually update the data
body: <p>This is my 1st question to this forum. I've been using sqlite3 for my project. I've been having trouble with the UPDATE statement used in my code. There are no errors or exceptions thrown, the data is not modified/updated in the table though. Here is the code snippet:</p>
  
  <pre><code>/* precompile the statement*/
  
  setreadstatus&lt;&lt;"UPDATE MESSAGES SET readmsg=? where ?= MessageHandler ";
  
  if(!(SQLITE_OK==sqlite3_prepare_v2(Database::Get_Instance().Get_Message_Db_Handler(),setreadstatus.str().c_str(), -1, &amp;set_readmsg, NULL)))
     {
        precompile_status = false;
       cout &gt;&gt; "Precompiling of setreadstatus failed";
     }
  else
  {
  if(true==Database::Get_Instance().Is_Db_Open())
     {
        //Begin transaction
        Database::Get_Instance().Begin_Trans_Message_Db();
        messagehandler = Message.MessageHandler().getString();
  
        /*Set the Read Status for the message handler */
        sqlite3_bind_int (set_readmsg,1,Message.Get_Read_Msg());
  
        sqlite3_bind_text (set_readmsg,2,messagehandler,-1,SQLITE_STATIC );
  
        int ret = sqlite3_step(set_readmsg);
        cout &gt;&gt; "return value of read message \"%d\"",ret;
        if(SQLITE_DONE != ret)
        {
          cout &gt;&gt; "setting read message status failed" ;
  
        }
        else
        {
           cout &gt;&gt;"Setting Read Status true";
           status = DB_MAP_SUCCESS;
        }
  
       sqlite3_reset(set_readmsg);
  
       Database::Get_Instance().End_Trans_Message_Db();
    }
  }
  </code></pre>
  
  <p>The sqlite3_step() returns 101 denoting success but the change is not reflected in the table. I basically want to update the readmsg flag to keep a tab on the read messages which apparently does not happen with this code of mine. I also like to add that my DB tables reside in the writable folders and I'm comfortably able to create tables and insert rows to those tables. All the trouble trickles in while I'm trying to update the values only.</p>
  
  <p>Regarding the bind statements, Get_Read_Msg() returns a boolean and the messagehandler used in bind_text is a string.</p>
  
  <p>Any kind of help will be greatly appreciated.</p>
  
  <p>P.S. I'm a newbie with sqlite and databases as such</p>