Help for this page

Select Code to Download


  1. or download this
    sub add_customer{
        my $sth = $dbh->prepare('INSERT INTO customers VALUES (?,?,?,?,?,?
    +,?,?,?,?,?,?)');
        die "Couldn't add customer" unless defined $sth;
        $sth->execute( @_ );
    }
    
  2. or download this
    sub add_customer {
        # $data_hash is a hashref representing the fields 
    ...
        chop $place_holders; # remove trailing comma
        return ( $fields, \@values, $place_holders );
    }