Welcome Guest, Not a member yet? Register   Sign In
Where something and something SQL
#1

[eluser]kolxoznik1[/eluser]
I have read user_guide and do not found WHERE something AND something.

So I need to check WHERE a = 3 and a = 5

so as I understand

Quote: $this->db->where('user_id', $user_id);
$this->db->where('follow_id', $follow_id);


two WHERE mean AND ?

Code:
function add_follow($user_id, $follow_id)
    {
        $this->db->select('user_id');
        $this->db->where('user_id', $user_id);
        $this->db->where('follow_id', $follow_id);
        $query = $this->db->get('user_follow');
        if ($query->num_rows() == 0) {
            $this->db->set('user_id', $user_id);
            $this->db->set('follow_id', $follow_id);
            $this->db->insert('user_follow');        
        }
        return FALSE;
    }

is it correct?


Messages In This Thread
Where something and something SQL - by El Forum - 02-01-2012, 07:03 PM
Where something and something SQL - by El Forum - 02-01-2012, 07:25 PM
Where something and something SQL - by El Forum - 02-01-2012, 09:15 PM
Where something and something SQL - by El Forum - 02-02-2012, 01:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB