Hi everybody!
I searched the lists quite a time for getting some clues for my problem,
but I cannot find a hint. So maybe someone out there can help me with my
problem:
I just installed the MySQL++ API and tried the first (modified) example:
int main()
{
Connection con("test");
Query query = con.query();
query << "select * from names";
Result res = query.store();
//this puts an empty line to stdout
cout << "Query: " << query.preview() << endl;
//this line gives the correct result
cout << "Records Found: " << res.size() << endl << endl;
Row row;
Result::iterator i;
i = res.begin();
row = *i;
//this works just fine: cout << row[1] << endl;
//this one not so fine:
cout << row["first_name"];
return 0;
}
The DB "test" contains one table called "names" with three columns
0 int id
1 char(60) first_name
2 char(60) last_name
Compiled with gcc 3.3.3 (Debian 20040429) (debian sid, kernel 2.6.5)
MySQL++ API 1.7.17
Output of the above program with col-id:
Records Found: 3
Thomas
Output of the program with col-name:
Records Found: 3
a
I do not understand why it works by using the column-id and why I just
get a plain "a" when using the column name? What stupid mistake do I make?
Thanks for any suggestions && greez from Austria,
Thomas Bergner