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 :(


In reply to Insert is Failing with DBI into mysql database, but no error by bobg2011

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.