[EMAIL PROTECTED] wrote:
Igor Tandetnik a écrit :
[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 each column*/
for (i = 0; i < sqlite3_column_count(pStat); i++)
{
switch (sqlite3_column_type(pStat,0))
{
case SQLITE_TEXT:
printf("%s ", sqlite3_column_text(pStat,0));
break;
}
break;
}
Why do you run the 'for' loop, if you unconditionally break out of it
on the very first iteration anyway?
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
ok thanks i understand my errors, is there a function to count the
number of rows ?
Inside your loop just use a counter, as follows
int rowcount = 0;
while ...
case SQLITE_ROW:
rowcount++;
....
.....
You have to have processed the entire select set before the number of
rows is known.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------