![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've tried to fetch a row from a table using mysqlpp::Query::use(const char *str) method, but all I got when I printed out row["item"] were all the same, a single letter t. |
|
then I tried to print the mysqlpp::ResUse out and it was always 1. |
perator
#3
| |||
| |||
|
|
mysqlpp::Connection con(false); con.connect("mysql_cpp_data", "localhost", "test", "test"); mysqlpp::Query query = con.query(); query << "select * from stock"; mysqlpp::ResUse res = query.use(); mysqlpp::Row row; while (row = res.fetch_row()) { std::cout << row["item"] << std::endl; } |
#4
| |||
| |||
|
|
ZeeGeek wrote: mysqlpp::Connection con(false); con.connect("mysql_cpp_data", "localhost", "test", "test"); mysqlpp::Query query =3D con.query(); query << "select * from stock"; mysqlpp::ResUse res =3D query.use(); mysqlpp::Row row; while (row =3D res.fetch_row()) { std::cout << row["item"] << std::endl; } =20 I replaced the code in usequery's try block with your code, and it produced just what I expected it to. Try that, and rebuild the examples within the MySQL++ tree. |
|
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsu... gmail (DOT) = com =20 =20 |
![]() |
| Thread Tools | |
| Display Modes | |
| |