I am moving my mysql++ cgis to a new fedora core 2 64bit server where I
compiled and installed mysql++-1.7.17
I know about the new Row.lookup_by_name() but my problem is different.
It does not matter if I use [int i] or lookup_by_name(char * i)... i
mostly get substrings or zero for ints though the value in the database
is surely different.
Examples:
string "Freelancer" becomes "Freel"
int 1 becomes 0
timestamp 20041010151621 becomes 20041
enum "read,write,search,delete" becomes "r"
only a few are correct and it is the same everytime I try it.
I wrote a small program to test it without everything else:
Connection db;
db.connect(getoption("db","database").c_str(),getoption("db","host").c_str(),getoption("db","username").c_str(),getoption("db","password").c_str());
Query query = db.query();
query << "SELECT * from "<<argv[1]<<" LIMIT 10";
Result result=query.store();
Result::iterator iter;
iter = result.begin();
Row row=*iter;
for (unsigned int i = 0; i < row.size(); i++)
{
cout << (result.names(i).c_str()) << " = \""<<row[i]<<
"\" =
\"" << row.lookup_by_name(result.names(i).c_str()) << "\"\n";
}