[eluser]solid9[/eluser]
Is these conditions correct?
Code:
function frontpage_records($per_page, $keyword, $country) {
if($country == 'all' OR $country == '' AND empty($keyword)) {
$query = $this->db->select('swapid, date_posted, offering, seeking, photo, video, country')
->from('swap')
->limit($per_page, $this->uri->segment(3))
->order_by('swapid', 'DESC')
->get();
} else {
$query = $this->db->select('swapid, date_posted, offering, seeking, photo, video, country')
->from('swap')
->where('country', $country)
->like('offering', $keyword)
->limit($per_page, $this->uri->segment(3))
->order_by('swapid', 'DESC')
->get();
}
if ($query->num_rows() > 0)
{
return $query->result_array();
} else {
return FALSE;
}
}
Can you guys please check.
I'm a little confused because it doesn't do what it suppose to do.
Thanks in advanced.