Re: [sqlite] Reading error outside the while

2007-10-10 Thread [EMAIL PROTECTED]
John Stanton a écrit : John Stanton wrote: [EMAIL PROTECTED] wrote: John Stanton a écrit : [EMAIL PROTECTED] wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values

Re: [sqlite] Reading error outside the while

2007-10-10 Thread John Stanton
John Stanton wrote: [EMAIL PROTECTED] wrote: John Stanton a écrit : [EMAIL PROTECTED] wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three".

Re: [sqlite] Reading error outside the while

2007-10-10 Thread John Stanton
[EMAIL PROTECTED] wrote: John Stanton a écrit : [EMAIL PROTECTED] wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". #include #include

Re[2]: [sqlite] Reading error outside the while

2007-10-09 Thread Teg
The original example's an accident waiting to happen. You've hard coded the results to 3 but, not limited the number of loops in the while loop so, you could easily crash/corrupt the stack. You'll crash if you have less than 3 results too. What happens if you only get one result from the while

Re: [sqlite] Reading error outside the while

2007-10-09 Thread [EMAIL PROTECTED]
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". #include #include int main(void) { sqlite3

Re: [sqlite] Reading error outside the while

2007-10-09 Thread [EMAIL PROTECTED]
Simon Davies a écrit : On 09/10/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". . . . const

Re: [sqlite] Reading error outside the while

2007-10-09 Thread Ken
You need to make a copy of the str instead of just capturing a pointer reference. try: my_array[i] = strdup(sqlite3_column_text(pStat, 0)); "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's

Re: [sqlite] Reading error outside the while

2007-10-09 Thread John Stanton
[EMAIL PROTECTED] wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". #include #include int main(void) { sqlite3 *db; sqlite3_stmt

Re: [sqlite] Reading error outside the while

2007-10-09 Thread Simon Davies
On 09/10/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I got an error when I try to read some data outside the while{}, inside the > while{} it's ok, an idea ? > test.db have just one "table1" and a "field1" with values "one", "two", > "three". . . . >const unsigned char

[sqlite] Reading error outside the while

2007-10-09 Thread [EMAIL PROTECTED]
Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". #include #include int main(void) { sqlite3 *db; sqlite3_stmt *pStat; const char *dbname =