DBIx-Broker

 view release on metacpan or  search on metacpan

Broker.pm  view on Meta::CPAN

    local $"  =  ", ";
    $self->{'sql'} = "INSERT INTO $table ( @fields ) VALUES ( @question_marks )";

    print { $self->{'debug_handle'} } "sql: $self->{'sql'}\nvalues: @values\n"  if  $self->{'debug'};

    $self->__sql_execute( \@values );
	return $self->{'statement'}->{'mysql_insertid'}  if  ( $self->{'driver'} eq 'mysql' );
}


sub update {
    my $self            =  shift;
    my $table           =  shift;                #   send only one table
    my %new_data        =  %{ shift @_ };
    my $stipulations    =  shift;
    my @fields          =  keys( %new_data );       #   these are promised to be in the same order,
    my @values          =  values( %new_data );     #   according to the docs
	
    if ( ! defined($self->{'db'}) ) {
		die "There is not a valid DB handle to update.\n";
    }



( run in 0.249 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )