simonodell has asked for the wisdom of the Perl Monks concerning the following question:
The price column in the database is a decimal(15,2)my $price = '23,356.00'; my $itemref = 'S10099'; print "price = $price\n"; $price =~ s/,//; print "new price = $price\n"; my $query = "UPDATE items SET price='$price' WHERE itemref='$itemref +';"; print $query; $sth = $dbh->prepare ( $query ); $sth->execute (); $sth->finish ();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bizzare comma bug
by kennethk (Abbot) on Jan 30, 2009 at 14:42 UTC | |
|
Re: Bizzare comma bug
by ikegami (Patriarch) on Jan 30, 2009 at 14:45 UTC | |
|
Re: Bizzare comma bug
by dreadpiratepeter (Priest) on Jan 30, 2009 at 14:46 UTC | |
|
Re: Bizzare comma bug
by Rodster001 (Pilgrim) on Jan 30, 2009 at 20:06 UTC | |
|
Re: Bizzare comma bug
by targetsmart (Curate) on Jan 31, 2009 at 07:27 UTC | |
|
Re: Bizzare comma bug
by Argel (Prior) on Jan 31, 2009 at 00:45 UTC | |
|
Re: Bizzare comma bug
by Anonymous Monk on Feb 02, 2009 at 01:14 UTC | |
|
Re: Bizzare comma bug
by Anonymous Monk on Feb 02, 2009 at 12:05 UTC | |
|
Re: Bizzare comma bug
by Anonymous Monk on Feb 01, 2009 at 00:03 UTC |