Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
i keep on getting the following error mesg: DBD::mysql::st execute failed: You have an error in your SQL syntax near 'NULL NULL NULL 'Login OK. someone pls help!!!while ( my (@log_entry) = $xlh->fetchrow_array ) { push(@log_entry, undef, "$_") ; $mlh->execute(@log_entry) ; last if $mch->err ; } sub get_log() { my $dbh = shift ; my $table = "log" ; my $field = join(',',@log_fields[0..6]) ; my $sth = $dbh->prepare( qq{ SELECT $field FROM $table LIMIT 25 } ) or db_err("Can't prepare statement: $DBI::errstr") ; $sth->execute or db_err("Can't execute statement: $DBI::errstr") ; return($sth) ; } sub put_log() { my $dbh = shift ; my $table = "log" ; my @field = @_ ; my ( $nph, $value_ph ) = "$#field" ; my $field = join(',',@field) ; while ( $nph-- > -1 ) { $value_ph .= '? ' ; } ; my $sth = $dbh->prepare( qq{ INSERT INTO $table ($field) VALUES ( $value_ph ) } ) or db_err("Can't prepare statement: $DBI::errstr") ; return($sth) ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: db to db update
by dws (Chancellor) on Aug 27, 2002 at 22:57 UTC | |
|
Re: db to db update
by abstracts (Hermit) on Aug 28, 2002 at 02:01 UTC |