Welcome Guest, Not a member yet? Register   Sign In
Concatenate database columns

Hi fellas....

I have a database with address and address_number columns.

On my search form, the client will type the address and number on the same field so I had to concatenate it and make a LIKE.

I found a way but I'm not sure it's the best.

$like['concat(address,"",address_number)'] = $house_address;

The concat() if a MySQL function.

On my Model class I have:

public function select($like = NULL) {
if(!is_null($like)) {

return $this->db->get('houses');

If there is a better solution, please tell me =)

If not, I hope it helps someone Wink

Theme © iAndrew 2016 - Forum software by © MyBB