vendredi 12 février 2016

SqlLite - Convert Table Array?

I am trying to convert 3 columns from an sqllite table to 3 arrays. I have the current code to get the DB:

sqlite3 *db; char *error;
int rc;
rc = sqlite3_open("db.sql", &db);
if (rc)
{
    cout << "Error Connecting";
    sqlite3_close(db);
}
else {
    char **results = NULL;
    int rows, columns;
    const char *sqlSelect = "SELECT name, surname, dob FROM data";
    sqlite3_get_table(db, sqlSelect, &results, &rows, &columns, &error);
    if (rc) {
        system("color 0c");
        cout << "Error executing query";
    }
    else {
    // What to put here?
    }
}

I am having trouble continuing, the documentation is a little hard for me to understand. How can I convert my array 'results' to something useful? (etc 3 arrays, dobs[] names[] surnames[])

Aucun commentaire:

Enregistrer un commentaire