Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Bizzare comma bug

by dreadpiratepeter (Priest)
on Jan 30, 2009 at 14:46 UTC ( [id://740189]=note: print w/replies, xml ) Need Help??


in reply to Bizzare comma bug

This code looks like it should work. here are a few things i would check.:
  • go into the sql tool for whatever DB you are using and try entering the command you think you are sending. The DB could have a trigger that does something to the data.
  • look at your schema, you are treating prices as a string in the sql statement, but it may be types are something else in the db and you are getting somekind of conversion bug.
  • try using placeholders instead of interpolation:
    my $query = "UPDATE items SET price=? WHERE itemref=?;"; print $query; $sth = $dbh->prepare ( $query ); $sth->execute ($price,$itemref);
    This may solve the datatyping issues above.
  • You are not checking the prepare or execute for errors, there is a good chance your code isn't updating anything in the db and you don't know it.
  • If all the fails, try moving the comma in the string and see if that changes the results. ie '233,56.00'. if it does that's more information.


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://740189]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found