title: query sqlite3 database multiple tables
body: <p>In the example below uses a single database table (Animals), which contains three columns (name, description, photo).</p>
  
  <p>If my database contains two tables (1.animals, 2.Cities), each with its columns (name, description, photo), how do I ask for eg. "names Cities", which is positioned in column 1 table 2 .,in combination with "animal description",positioned in table 1 column 2,to make an object with these "values".</p>
  
  <p>referncing this.....(char *)sqlite3_column_text(compiledStatement, 1)....</p>
  
  <p>Thank you.</p>
  
  <pre><code>    // Open the database from the users filessytem
  if(sqlite3_open([databasePath UTF8String], &amp;database) == SQLITE_OK) {
      // Setup the SQL Statement and compile it for faster access
      const char *sqlStatement = "select * from animals";
      sqlite3_stmt *compiledStatement;
      if(sqlite3_prepare_v2(database, sqlStatement, -1, &amp;compiledStatement, NULL) == SQLITE_OK) {
          // Loop through the results and add them to the feeds array
          while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
              // Read the data from the result row
              NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
              NSString *aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
              NSString *aImageUrl = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
  
              // Create a new animal object with the data from the database
              Animal *animal = [[Animal alloc] initWithName:aName description:aDescription url:aImageUrl];
  </code></pre>