Welcome Guest, Not a member yet? Register   Sign In
MySQL DATE_FORMAT with Active Record
#3

[eluser]Référencement Google[/eluser]
Whoooops... just got it !
If it can help somebody:

Code:
function list_all($lang, $limit = FALSE, $offset = FALSE)
    {

        $this->db->select('*');
        $this->db->select("DATE_FORMAT(datetime, '%d.%m.%Y à %H:%i:%s') AS datetime");

        $this->db->where('lang', $lang);
        $this->db->limit($limit);
        $this->db->offset($offset);
        $this->db->order_by('datetime', 'desc');
        $query = $this->db->get('news');

        return $query->result();
    }


Messages In This Thread
MySQL DATE_FORMAT with Active Record - by El Forum - 03-14-2008, 03:00 PM
MySQL DATE_FORMAT with Active Record - by El Forum - 03-14-2008, 03:10 PM
MySQL DATE_FORMAT with Active Record - by El Forum - 03-14-2008, 03:11 PM
MySQL DATE_FORMAT with Active Record - by El Forum - 02-20-2009, 07:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB