Welcome Guest, Not a member yet? Register   Sign In
My join is not working
#1

I have a search field in my form which searches data from a database and displays it on a result page. When I try to search data I get this error.
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined index: names

Filename: views/searchresults.php

Line Number: 43

I know the data I am passing to the view does not contain the 'names'  field which means the query I am using is not retrieving this value from the database. Here is my database query
Code:
//this function gets all the contacts given a cerain parameter
   public function search_data($param) {
       
           //query
           $this->db->select('users,numbers');
           $this->db->from('phones');
           $this->db->like('phones.users',$param);
           $this->db->or_like('phones.numbers', $param);
           $this->db->or_like('offices.names', $param);
           $this->db->join('offices', 'phones.offices = offices.id', 'left');
         

           //return the result
           $query = $this->db->get();

           return $query->result_array();
       
   }

The 'names' field is in my office table, thus it must be my join function which is not working. Any help will be greatly appreciated
Reply


Messages In This Thread
My join is not working - by andyblem - 02-19-2015, 06:00 AM
RE: My join is not working - by Avenirer - 02-19-2015, 06:46 AM
RE: My join is not working - by marcos - 02-19-2015, 07:49 AM
RE: My join is not working - by edellascenza - 02-19-2015, 10:54 AM
RE: My join is not working - by andyblem - 02-19-2015, 11:43 PM
RE: My join is not working - by Rufnex - 02-20-2015, 02:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB