I'm using mysql++ to get data from different tables.
Here is an extract of my code:
// --- connect to database and create template query
cerr << "Error: Could not connect to database" << endl;
mysqlpp::Query query = conn.query("SELECT * FROM %1 WHERE col0 = %0q");
// --- get data from database
what1 and what2 are strings I get from commandline.
The code compiles w/o warnings or errors, but when I execute
the programm I get:
terminate called after throwing an instance of 'mysqlpp::BadParamCount'
what(): Not enough parameters to fill the template.
Using the command
cout << query.str(what1,"table1") << endl;
works fine. I see the correct query with both parameters on the std out.
Does anyone know what is going wrong here?