"Rob Roudebush" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I've seemed to have narrowed down the problem to $sth variable, I guess I can't declare this as a private variable because it "prepares" it and needs to have it at least local or global to access it? > Rob Roudebush <[EMAIL PROTECTED]> wrote: > I think pulling the ID field may be causing the problem with use strict; ? > > $dbh = DBI->connect( "DBI:mysql:turnover", "root", "", {RaiseError => 1, AutoCommit => 0}); > $sth = $dbh->do( "insert into maintenance (owner, email, maintype, title, requested, engineer, ticket, impact, comm > .....
the do() method dosent return a statement handle. The transaction is complete after do() executes sucessfully. remove: ``$sth = '' from above, and then wrap $sth in my() in the line below, as in: > $sth = $dbh->prepare("select ID from maintenance"); this should read: my($sth) = $dbh->prepare("select ID from maintenance"); > $sth->execute(); > while ($ref = $sth->fetchrow_hashref()){ > $ID = $ref->{'ID'};} > $dbh->disconnect; > > Mark Bergeron wrote: Rob, > use strict; shouldn't really affect the syntax of any DBI handle or statement. ... When strict is giving you problems, its because you are doing something wrong, even though you swear you arent. Ive learned to trust perl before I trust my own code, its a good policy. Todd W. [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]