Welcome Guest, Not a member yet? Register   Sign In
Problems with querys
#11

[eluser]daweb[/eluser]
Hi everybody,

this is my personal solution to solve this problem.

What do u think about that?

Code:
function get_next_prev($cod, $mode)
    {
        switch($mode)
        {
            case 'next' :
                $this->db->select_min('rec.cod', 'cod');
                $this->db->where('rec.cod >', $cod );
            break;
            
            case 'prev' :
                $this->db->select_max('rec.cod', 'cod');
                $this->db->where('rec.cod <', $cod );
            break;
        }
        $query = $this->db->get('rec');
        if($query->num_rows() > 0)
        {
            return $query->row()->cod;
        }
        
        return FALSE;
    }


Messages In This Thread
Problems with querys - by El Forum - 03-05-2008, 05:02 PM
Problems with querys - by El Forum - 03-05-2008, 05:09 PM
Problems with querys - by El Forum - 03-05-2008, 05:21 PM
Problems with querys - by El Forum - 03-05-2008, 05:25 PM
Problems with querys - by El Forum - 03-05-2008, 05:29 PM
Problems with querys - by El Forum - 03-05-2008, 05:34 PM
Problems with querys - by El Forum - 03-05-2008, 05:35 PM
Problems with querys - by El Forum - 03-05-2008, 05:43 PM
Problems with querys - by El Forum - 03-05-2008, 06:41 PM
Problems with querys - by El Forum - 03-05-2008, 06:59 PM
Problems with querys - by El Forum - 04-04-2008, 06:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB