[sqlite] Re: Reading error outside the while

2007-10-10 Thread Igor Tandetnik
[EMAIL PROTECTED] wrote: while(sqlite3_step(pStat) != SQLITE_DONE) { switch (sqlite3_step(pStat)) { You call sqlite3_step twice on every iteration, which means you are only looking at every other row. That's probably not what you wanted. case SQLITE_ROW: /*Get

[sqlite] Re: Reading error outside the while

2007-10-09 Thread Igor Tandetnik
[EMAIL PROTECTED] wrote: sqlite3_open(dbname, ); sqlite3_prepare_v2(db, sql, -1, , 0); while(sqlite3_step(pStat) == SQLITE_ROW) { row = (char *)sqlite3_column_text(pStat, 0); my_array[i] = malloc( sizeof row * sizeof *my_array[i]); memcpy (my_array[i], row, sizeof row * sizeof