Welcome Guest, Not a member yet? Register   Sign In
codeigniter query problem
#4

[eluser]Bigil Michael[/eluser]
thanks for your reply.

solved my problem like this way

Code:
function lekhanam($lekhanam) {
  
  
  $lek = explode(',', $lekhanam);
  $temp='';
  if (!empty($lek))
  {  
   foreach ($lek as $a1)
   {    
    $temp[]= ' a.id = '.$a1;
   }  
  }
  $temp2 = implode(' or ', $temp);
  $where = "(".$temp2.")";
  
  $this->db->limit(5);
  $this->db->where($where);
  $this->db->where('a.status',1);
  $this->db->where('at.status',1);
  $this->db->select('a.*, ac.category_name, at.id as author_id, at.name, at.photo as authorimage');
     $this->db->from('articles AS a');
     $this->db->join('article_categories AS ac', 'ac.category_id = a.category_id');
     $this->db->join('authors AS at', 'at.id = a.author_id');
     $result= $this->db->get();
    return $result->result();
}


Messages In This Thread
codeigniter query problem - by El Forum - 02-07-2013, 01:50 AM
codeigniter query problem - by El Forum - 02-07-2013, 09:07 PM
codeigniter query problem - by El Forum - 02-07-2013, 11:11 PM
codeigniter query problem - by El Forum - 02-08-2013, 02:06 AM
codeigniter query problem - by El Forum - 02-10-2013, 12:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB