I'm using the Zend_db_table insert() method and get an error. The error is because I receiving data from POST as a string but the datatype for the table column is float. So it creates error when I try to insert string type into float column.
What's the proper way to resolve this?
Here's the model code:
class User_Model_Forms extends Zend_Db_Table_Abstract {
public function save(array $data) {
return $this->insert($data);
}
...
Here's the controller code:
$form = new User_Form_Firstpart();
if ( $form->isValid($request->getPost()) ){
$data = $form->getValues();
$formModel = new User_Model_Forms();
$formModel->save($data);
...
Here's the database table: