types - Zend Db Float Problem -
i have mysql table structured: float(10,2)
for example insert row.
$value = array('price' => '13539.51'); $db->insert($value);
when check row phpmyadmin, fine. when read row zend db, price value "13539.509765625". how can fix problem.
$select = $db->select(); $select->where('id = ?' 1); echo $db->fetchrow($select)->price; //13539.509765625
i think issue lies data type chose column , not zend_db. might want alter decimal(10,2).
http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html
cheers, angel
Comments
Post a Comment