in reply to get response from mysql do after executing the querry like load , update etc

By using DBI.

I only can give you a very broad answer, sorry. If you told us where exactly you encounter problems, maybe I could give you a more specific answer.

  • Comment on Re: get response from mysql do after executing the querry like load , update etc

Replies are listed 'Best First'.
Re^2: get response from mysql do after executing the querry like load , update etc
by sandy.perl (Initiate) on Feb 16, 2009 at 12:24 UTC
    i can execute the mysql querry using DBI. i want to know the status of the table after executing the querry, like if i load the table with data, then i want to catch the mysql db response like, Query OK, 0 rows affected, 7 warnings (0.00 sec) Records: 7 Deleted: 0 Skipped: 7 Warnings: 7

      Look in DBI for the number of rows affected. For the rest of the information, I don't know. Likely looking in DBI or DBD::mysql or the MySQL documentation will help you.

      I believe a combination of DBI and DBD::mysql can give you what you are looking for. The $sth->do method returns the number of items affected. The DBD::mysql has a 'mysql_warning_count' parameter that is non-portable, if you want to get the warnings.

      I suspect, however, that you are looking for the exact string you see from the CLI '0 rows affected, 7 arnings...). This is a common desire, but it is not coming from the engine -- this comes from the CLI (ie, running the 'mysql' command from the *nix prompt). I believe you can generate all this info yourself, just not with a single call