Jump to content

concatenate field names into one and return


php_begins

Recommended Posts

I have the following mysql query:

        $lead_query=$this->db->query(" 
	   SELECT `first_name`, `last_name` , `state` FROM leads WHERE `lead_id`='$lead_id'
	   "); 
	   $this->view->lead_query=$lead_query->fetchALL();

 

Now when I retrieve the above details  I need to return the first_name last_name together(separated as space) and the name of the key as client_name in the array.

 

I need it that way because when i return a json_encode($lead_query), I want to return the first_name.last_name as client_name.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.