List:MySQL++« Previous MessageNext Message »
From:patham Date:August 7 2000 5:49pm
Subject:Only get one row on two.
View as plain text  
Hi

Please excuse my bad english :)

I'm trying to use mysql++ to access the records of my database but I encounter one
big problem : I only get the half of the records.
I'm using the same technique as in the examples, (the iterator to access the rows) but I
use this piece of code :

...(connection and query)
Result::iterator i;
Row row;
for (i = res.begin(); i != res.end; i++)
    {
    row = i*;
    if (bool(row)) cout << row[0] << "   " << row[1] << endl;
    };
...

If I use this :

...(connection and query)
Result::iterator i;
Row row;
for (i = res.begin(); i != res.end; i++)
    {
    row = i*;
    cout << row[0] << "   " << row[1] << endl;
    };
...

I get segfaults because the very first row seems not to be valid. ( bool(row) = false, i
have checked )
Thus, only the second, the fourth, and so on... rows seem to be valid.

Any ideas ?
Thanks

patham.


Thread
Only get one row on two.patham7 Aug