Pdo::Param for Type Decimal

PDO::PARAM for type decimal?

There isn't any PDO::PARAM for decimals / floats, you'll have to use PDO::PARAM_STR.

What is the best way to bind decimal / double / float values with PDO in PHP?

AFAIK PDO::PARAM_STR is the way to go.

Why I can not insert 0.00 decimal value with PDO into my database?

The answer in comments pointed me to the right direction. Problem lies not in decimal 0.00, but in foreign key which im trying to set to an empty string, which is invalid NULL and foreign key.

A quick fix would be to check if string is empty and set it to NULL:

if (empty($position['order'])) {
$position['order'] = NULL;
}

Cannot update mysql with PDO when variable is a decimal

Hello Guys: I finally figured out that the problem was totally unrelated to what I posted; I am sorry if I wasted anyone's time and I appreciate all of your help…

Basically there was a function "higher up in the stream" that was making it fail - and it had nothing to do with non-integers being entered; but because with this function they were always non-integers it really looked like that was the cause...



Related Topics



Leave a reply



Submit