title: How to retrieve sqlite with select statement and assign to vector then assign to a string
body: <p>The following is what I had tried on getting vector pushback and what I lack of now is to assign it to a string:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sqlite3.h&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main()
  {
  
      sqlite3 *db;
      sqlite3_stmt * stmt;
      std::vector&lt; std::vector &lt; std:: string &gt; &gt; result;
      for( int i = 0; i &lt; 4; i++ )
          result.push_back(std::vector&lt; std::string &gt;());
  
      if (sqlite3_open("abeserver.db", &amp;db) == SQLITE_OK)
      {
          sqlite3_prepare( db, "SELECT * from abe_account;", -1, &amp;stmt, NULL );
                                //preparing the statement
          sqlite3_step( stmt ); //executing the statement
  
          while( sqlite3_column_text( stmt, 0 ) )
          {
              for( int i = 0; i &lt; 4; i++ )
                  result[i].pushback( std::string( (char *)sqlite3_column_text( st, i ) ) );
              sqlite3_step( stmt );
          }
  
      }
      else
      {
          cout &lt;&lt; "Failed to open db\n";
      }
  
      sqlite3_finalize(stmt);
      sqlite3_close(db);
  
      return 0;
  }
  </code></pre>
  
  <p>Below is my database look on sqlite:</p>
  
  <pre><code>sqlite&gt; select * from abe_account;
  admin|Peter John|admin_account|password
  </code></pre>
  
  <p>I want to get the value "admin" &amp; "password" together through sql select statement and then assign them to a string, how do i use vector to obtain this element [0] and element [3] to a string. as i need it for a if compareTo later on.</p>
  
  <p><strong>Thanks for all the help !!</strong></p>