bobg2011 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Guys,
I'm having some basic problems with inserts into a database appearing to work 100% of the time, however when I check the database via GUI or a select statement the inserted data isn't there! I have tried # Database Handler
$dbh = DBI->connect("DBI:mysql:database=mytedsdb;host=localhost", "User", "Password", {AutoCommit => 1,'Rais +eError' => 1}); $device_sth = $dbh->prepare('INSERT INTO Device VALUES (?,?,?,?,?)'); $device_sth>execute($devicetype,$deviceName,"test",trim($cmdHoH{$perso +nality}->{'vendor'}),trim($version)); $dbh->disconnect; AND with $dbh->do($query) style instead, wrapped in an eval.
The $dbh->do always returns 1 however I don't always see the entries in my database. Any idea an how I can troubleshoot this? I've been looking at it for hours and its driving me CRAZY.... thanks :(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Insert is Failing with DBI into mysql database, but no error
by JavaFan (Canon) on Oct 24, 2011 at 10:54 UTC | |
by bobg2011 (Novice) on Oct 24, 2011 at 11:26 UTC |