  | | | Problem with DELETE | Problem with DELETE 2006-08-13 - By Muller Gael
Back Hello everyone.
I'm just starting with mysql++ and I have a problem with a DELETE query:
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ---- ---- ---- ---- mysqlpp::Connection db("CycomT", "localhost", "root", "");
mysqlpp::Query query = db.query(); query << "SELECT * FROM actions"; mysqlpp::Result result = query.store(); if (result) { if (result.num_rows() != 0) { try { mysqlpp::Row row; while (row = result.fetch_row()) { std::cout << row["type"]; } } catch (mysqlpp::EndOfResults& er) { //on ne fait rien } query.reset(); query << "DELETE FROM actions"; query.execute(); } }
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ---- ---- ---- ---- ---
The DELETE query seems to be executed before the SELECT query. Indeed my table is'nt empty before, but my program doesn't print anything. Then, my table is empty as expected. I don't understand why. Without the DELETE query, my program prints the content correctly.
Sorry for my English, Thanks for help
-- Muller Gael
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=mysql@(protected)
|
|
 |