before I begin sorry for the cross post but i'm desperate
The routine in question is below. It's pretty straight forward its a series of loops 
which basically matches the row then dumps data stored in hash ref into the DB. for 
some reason the script runs with no errors (ran with strict)  I can verify that the 
data is being iterated, but when I check the Db no data is updated, the int fields 
have been updated to 0 as opposed to NULL. is anyone seeing somethign I'm not.




sub write_db_2 {
    my ($ar_info,$table) = @_;
    my ($dbh,$sth,$k,$rh_row);
    $dbh = connect_try("rowan","5340brig");
    foreach $k (keys (%{$ar_info->[1]})){
        if ($table eq "prop_info"){
                $sth = $dbh->prepare ("UPDATE prop_info
                                       SET $k = ?
                                       WHERE prop_str_addr = ?;") or
                                       err_trap("failed to prepare statement\n");
            }elsif ($table eq "own_info"){
                $sth = $dbh->prepare ("UPDATE own_info
                                       SET $k = ?
                                       WHERE own_str_addr = ?;") or
                                       err_trap("failed to prepare statement\n");


            }
        foreach $rh_row (@$ar_info) {
            print "::$k=>$rh_row->{$k}";
            $sth->bind_param (1,$rh_row->{$k});
            if ($table eq "prop_str_addr") {
                $sth->bind_param (2,$rh_row->{prop_str_addr});
            }elsif  ($table eq "own_str_addr") {
                $sth->bind_param (2,$rh_row->{own_str_addr});
            }
            $sth->execute() or
                err_trap("failed to execute statement\n");

            }
        print "\n===========================\n";

    }
    $sth->finish();
    $dbh->disconnect or
        err_trap("failed to disconnect statement\n");
}


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to