Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl, MySQL and the work done

by rnewsham (Curate)
on Mar 20, 2013 at 22:55 UTC ( [id://1024629]=note: print w/replies, xml ) Need Help??


in reply to Perl, MySQL and the work done

$dbh->{'mysql_info'}; seems to work for me, test code below, credit to kschwab for pointing this out

use strict; use warnings; use DBI; my $database = 'test'; my $dsn = "DBI:mysql:$database;mysql_read_default_file=$ENV{HOME}/.my. +cnf"; my $dbh = DBI->connect($dsn,undef,undef,{ RaiseError => 1 }); $dbh->do("update foo set bar=1"); my $info = $dbh->{'mysql_info'}; my ( $matched, $changed, $warnings ) = $info =~ /Rows matched: (\d+) +Changed: (\d+) Warnings: (\d+)/; print "Matched: $matched\nChanged: $changed\nWarnings: $warnings\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1024629]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-26 03:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found