in reply to XML::Twig to mysql totally lost

Move all the  $insert->bind_param( out of the callback (sub indexfile), you only need to do it once

Replies are listed 'Best First'.
Re^2: XML::Twig to mysql totally lost
by bcnagle (Novice) on Jul 15, 2011 at 08:38 UTC
    so $insert->bind_param( 1, $path, 2, etc, 3, etc, 4 etc, 5, etc, etc, etc); ??
      Um, I said move, not rewrite :) Move as in
      my $insert = ... ... sub indexfile { ... $insert->bind_param( ... ... $insert->execute();
      becomes
      my $insert = ... $insert->bind_param( ... ... ... sub indexfile { ... $insert->execute();
      you prepare once, you bind once, you execute many many many many times, like each time you update your bound params :)