Purposely done to the code to simplify, post, to help each Daniel
# include & lt; Iostream>code is very simple, is to connect to the database after aries_role, then from the role of role table lookup with ID 99
# include & lt; Mysql++. H>
Using namespace STD.
Int main ()
{
Const char * db="aries_role", *="127.0.0.1" server, * user="root", * pass="123456";
Mysqlpp: : Connection conn (false);
//connect to the database
If (conn. Connect (db server, the user, pass))
{
//from the role of role table lookup with ID 99
Mysqlpp: : Query Query=conn. Query (" select * from role where id=99 ");
Mysqlpp: : StoreQueryResult resu=query. The store ();
Int nRows=resu. Num_rows ();
If (nRows & gt; 0)
{
Cout
Cout}
The else
{
std::cout <"Failed to get the item list:" & lt;}
}
return 0;
}
But the result run to the last time is always complains!!!!!!!!!!
Mean variable resu cause stack overflow??????
I had print:
Cout
Cout
What went wrong, consult everybody database, niche thanked the first
CodePudding user response:
By himself first, cool people to see, that is a question which I met yao onlyCodePudding user response:
Problem has been solved, because the Debug version of the program with the Release version of the library files...