Welcome Guest, Not a member yet? Register   Sign In
Set Posts activ/inactiv
#7

[eluser]Zimooon[/eluser]
Hey

I call this function: getactivePosts() :

Code:
}      

  function getactivePosts($active = FALSE) {
    if($active == TRUE)
    {
     $this->db->where('active',1);
    }
    $query = $this->db->get('posts');
    $posts = array();

    foreach ($query->result() as $row) {
        $posts[] = array(
            'id' => $row->id,
            'title' => $row->title,
            'content' => $row->content,
            'date' => $row->date,
            'active' => $row->active
            
            
        );
    }

    return $posts;
}

In my database active is :

typ: tinyint
length/set : 1
standard: NULL
attribute: unsigned
Null: "checked"


Messages In This Thread
Set Posts activ/inactiv - by El Forum - 04-15-2011, 01:52 AM
Set Posts activ/inactiv - by El Forum - 04-15-2011, 04:31 AM
Set Posts activ/inactiv - by El Forum - 04-15-2011, 08:34 AM
Set Posts activ/inactiv - by El Forum - 04-15-2011, 12:06 PM
Set Posts activ/inactiv - by El Forum - 04-18-2011, 09:43 AM
Set Posts activ/inactiv - by El Forum - 04-18-2011, 10:48 AM
Set Posts activ/inactiv - by El Forum - 04-19-2011, 01:11 AM
Set Posts activ/inactiv - by El Forum - 04-19-2011, 03:55 AM
Set Posts activ/inactiv - by El Forum - 04-19-2011, 01:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB