[ale] DBD::mysql:st execute warning

Jason Etheridge phasefx at magusaptus.com
Fri Apr 30 12:35:27 EDT 2004


Christopher Fowler wrote:
> My perl program keeps giving me this error when I try to insert a
> record.  The record is not inserted.  How can I get DBD to print the
> warning so I can fix it?

I'd turn off automatic error checking

	$dbh->{PrintError} = 0;
	$dbh->{RaiseError} = 0;

and plug a

	or die "$DBI::errstr"

after every DBI command.  Or you could use

	or die $dbh->errstr()

and

	or die $sth->errstr()

depending on which handler you're using.  The $DBI:: stuff works with 
the last handle used.

I haven't used the automatic error checking.  Using it might be 
preferable if the messages are just as verbose.

-- Jason



More information about the Ale mailing list