[eluser]Firstrow[/eluser]
My view file is simple (using parser):
title: {title}
keywors: {keywords}
But the problem is not in view file. Problem is in inserting/updateing data thru Active Record
Becouse it's writing
0 in db instead of empty string.
I've wrote this function to avoid my problem:
Code:
function _delete_zero($arr)
{
foreach ($arr as $k => $v)
{
if ($v == '')
{
$arr[$k] = NULL;
}
}
return $arr;
}
and using it in each model function:
Code:
$data = $this->_delete_zero($data);
$this->db->update('settings',$data);
and its worked for me. And i dont know how it will work in other Db insted of MySql.
I want to know why AR inserting
0.