dsb has asked for the wisdom of the Perl Monks concerning the following question:
Ok here's the dilly-yo.
I've got a Perl app using DBI with a MySQL database. I keep getting an error and I can't spot why(neither can my boss). So I'm wondering if there are any bugs with our versions of DBI or DBD::mysql(or my app for that matter ;).
Okay here's code in abbreviated form. The parts that involve the error are exact:
And the error:use DBI; use strict; # query in question my $sth_sts = $dbh->prepare("UPDATE players SET t_id=?, bats=?, throws +=?, status=? WHERE id=?"); my $i; foreach $i (0 .. $#$prec) { # $prec is defined elsewhere # blah # blah # blah # blah # execute in question $sth_sts->execute($tid,$p->{P_BATS},$p->{P_THROWS},$p->{P_STATUS}, +$p->{P_PLAYERID}) or print "$DBI::errstr\n"; # blah }
And a sample of what the values plugged into the query should be:Unknown column 'R' in 'field list'
$tid = 20; # or any other 2 digit int $p->{P_BATS} = 'R'; # or 'L','S' $p->{P_THROWS} = 'R'; # or 'L' $p->{P_STATUS} = 'A'; # or 'D','I','M' $p->{P_PLAYERID} = 1846404; # or any other int up to 10 digits
Also, I figured you'd probably like to know the versions of DBI and DBD::mysql...oh and Perl ;)
Again, I'm at a complete loss. I thought it might be a problem with the quoting of the variables(which still seems likely to me), but I can't figure out where the problem is occuring or how to fix it.
Thanks in advance.
Amel - f.k.a. - kel
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI/DBD::mysql bugs?
by Fletch (Bishop) on Apr 09, 2002 at 18:07 UTC | |
|
Re: DBI/DBD::mysql bugs?
by dws (Chancellor) on Apr 09, 2002 at 18:08 UTC | |
|
Re: DBI/DBD::mysql bugs?
by perlplexer (Hermit) on Apr 09, 2002 at 18:26 UTC | |
by dsb (Chaplain) on Apr 09, 2002 at 18:59 UTC | |
by perlplexer (Hermit) on Apr 10, 2002 at 01:25 UTC | |
by dsb (Chaplain) on Apr 10, 2002 at 02:38 UTC | |
|
Re: DBI/DBD::mysql bugs?
by perlplexer (Hermit) on Apr 10, 2002 at 03:08 UTC |