Here is my code
int main(int argc,char *argv[])
{
mysql_init(&mysql);
connection = mysql_real_connect(&mysql,.............,"3306",0);
if (connection == NULL)
{
cout << mysql_error(&mysql);
return 1;
}
else
{
int id=1;
mysqlpp::Query query=connection.query("select * from pipe");
//query3<<"select pipe_id from pipe where version_id='"<<id<<"'";
if (mysqlpp::StoreQueryResult ares=query.store());
for(size_t i=0;i<ares.num_rows();i++)
38 cout<<ares[i]["version_id"]<<ares[i]["pipe_id"]<<std::endl;
// mysql_query(&mysql,query3.str().c_str());
}
mysql_close(connection);
return 0;
};
I am getting this error
In function ‘int main(int, char**)’:
error: request for member ‘query’ in ‘connection’, which is of non-class type ‘MYSQL*’