Nicolas Deroche
2013-06-26 08:57:33 UTC
Hello,
I'm trying to execute a basic SELECT statement on a MySQL backend, like
this:
*dbs::Server* server = new dbs::Server();
soci::statement st =
(sql.prepare << "SELECT linkname, name, engine, listening_ip,
listening_port, auth_id, auth_pw, max_clients, parent_linkname, childs, id
FROM `" << Server::table_name << "` WHERE `linkname`=':ii'",
soci::use(linkname, "ii"),
soci::into(server->linkname),
soci::into(server->name),
soci::into(server->engine_type),
soci::into(server->listening_ip),
soci::into(server->listening_port),
soci::into(server->auth_id),
soci::into(server->auth_pw),
soci::into(server->max_clients),*
*soci::into(server->parent_linkname),
soci::into(server->childs),
soci::into(server->id));
st.execute();
if(!st.got_data())
{
std::cout << "SQL = SELECT linkname, name, engine, listening_ip,
listening_port, auth_id, auth_pw, max_clients, parent_linkname, childs, id
FROM `" << Server::table_name << "` WHERE `linkname`='" << linkname << "'"
<< std::endl;**
delete server;
throw Server::does_not_exist();*
}
Thing is, this request works in mysql workbench, but not here?
What could be wrong ? I don't get it.
thanks, nico
I'm trying to execute a basic SELECT statement on a MySQL backend, like
this:
*dbs::Server* server = new dbs::Server();
soci::statement st =
(sql.prepare << "SELECT linkname, name, engine, listening_ip,
listening_port, auth_id, auth_pw, max_clients, parent_linkname, childs, id
FROM `" << Server::table_name << "` WHERE `linkname`=':ii'",
soci::use(linkname, "ii"),
soci::into(server->linkname),
soci::into(server->name),
soci::into(server->engine_type),
soci::into(server->listening_ip),
soci::into(server->listening_port),
soci::into(server->auth_id),
soci::into(server->auth_pw),
soci::into(server->max_clients),*
*soci::into(server->parent_linkname),
soci::into(server->childs),
soci::into(server->id));
st.execute();
if(!st.got_data())
{
std::cout << "SQL = SELECT linkname, name, engine, listening_ip,
listening_port, auth_id, auth_pw, max_clients, parent_linkname, childs, id
FROM `" << Server::table_name << "` WHERE `linkname`='" << linkname << "'"
<< std::endl;**
delete server;
throw Server::does_not_exist();*
}
Thing is, this request works in mysql workbench, but not here?
What could be wrong ? I don't get it.
thanks, nico