Welcome Guest, Not a member yet? Register   Sign In
Active Record Inserting 0
#1

[eluser]Firstrow[/eluser]
Hello all,
I have a problem with Active Record inserting.

Code in controller:
Code:
function insert()
    {
        $data = array(
        'title' => $this->input->post('title'),
        'keywords' => $this->input->post('keywords'),
        etc...
        );

        $this->model_name->insert($data);
    }

Code in Model:

Code:
function insert($data)
    {
        $this->db->insert('settings',$data);
    }


sql:
Code:
`title` varchar(255) NOT NULL,
`keywords` varchar(255) NOT NULL,


Here is my problem:
if title or keywords in $data array are empty its inserting 0
but i need to insert real empty string not 0.

Can somebody help me?


Messages In This Thread
Active Record Inserting 0 - by El Forum - 08-28-2008, 06:25 AM
Active Record Inserting 0 - by El Forum - 08-28-2008, 07:25 AM
Active Record Inserting 0 - by El Forum - 08-28-2008, 07:48 AM
Active Record Inserting 0 - by El Forum - 08-28-2008, 08:13 AM
Active Record Inserting 0 - by El Forum - 08-28-2008, 08:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB