Welcome Guest, Not a member yet? Register   Sign In
Filtering array values
#1

I have a model :
PHP Code:
           public function biens_vente()
 
           {
 
                       $query $this->db->select('')
 
                       ->from('biens')
 
                       ->where('actif''1')
 
                       ->where('rent','0')
 
                       ->get();

 
                       if($query->num_rows()!==0)
 
                       {
 
                                   return $query->result();
 
                       }
 
                       else
                        
{
 
                                   return FALSE;
 
                       }
 
           
and a Controller :

PHP Code:
public function ventes()
 
           {
 
                       if($this->Biens_model->biens_vente()== FALSE)
 
                       {
 
                             $this->data['erreur'] = "BLABLABLA";
 
                       }
 
                       else
                        
{
 
                             $this->data['biens'] = $this->Biens_model->biens_vente();
 
                       }
 
                       $this->data['title'] = "VENTE";
 
                       $this->render('vente_view');
 
           
In the results I got rows like 'slide1' 'slide2' .... if the row is empty,
I would like to filter the empty rows as I would with an array_filter() before sending to view
How can I do that properly ?
Reply


Messages In This Thread
Filtering array values - by cybersven - 03-31-2017, 08:08 AM
RE: Filtering array values - by InsiteFX - 03-31-2017, 10:36 AM
RE: Filtering array values - by cybersven - 04-01-2017, 02:30 AM
RE: Filtering array values - by InsiteFX - 04-01-2017, 04:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB