<?xml version="1.0" encoding="windows-1252"?>
<node id="1005718" title="Difference in perl_mod" created="2012-11-26 12:14:43" updated="2012-11-26 12:14:43">
<type id="115">
perlquestion</type>
<author id="925103">
himik</author>
<data>
<field name="doctext">
&lt;p&gt;Hello once again monkers!!

I have this code
&lt;code&gt;
  use DBI;
 
  sub simpleconnect
    {
       my $dbh;
       eval {$dbh=DBI-&gt;connect("dbi:Pg:dbname=$dbname;host=$host;port=$port", $dbuser, $dbpass, {AutoCommit =&gt; 0});}

       if ($dbh)
         {
           $dbh-&gt;disconnect();
         }
    }

  my $dbh;
  eval {$dbh=DBI-&gt;connect("dbi:Pg:dbname=$dbname;host=$host;port=$port", $dbuser, $dbpass, {AutoCommit =&gt; 0});}

  if ($dbh)
    {
      &amp;simpleconnect();

      my $i=0;
my
      while ($i&lt;=7)
        {
          $result=0; 

          my $sth=$dbh-&gt;prepare("INSERT INTO table1 (col1,col2) values( ?, 'test')");
          if ( $sth-&gt;execute($i) )
            {
              $result=1 if ( $sth-&gt;rows()==1 );
            }
          $sth-&gt;finish;
        }
      $dbh-&gt;commit() if ( $result );
      $dbh-&gt;disconnect();
    }
&lt;/code&gt;

My question is why when i start the script through mod_perl in my table 1 is only 1 query the last one.

And when i start it without mod_perl every thing is OK. I have all my rows in table1.
&lt;/p&gt;</field>
</data>
</node>
