CodeIgniter-MY_Model
CodeIgniter-MY_Model copied to clipboard
Like and Select
Hi, I can't use methos like and select this is the menssage:
No method with that name (select) in MY_Model or CI_Model.
And No method with that name (like) in MY_Model or CI_Model.
I use Codeigniter 3.0.6
Use fields instead select. Also use like function as $this->db->like("field", $value);
Sorry for my bad English, I Beginner in web develepment, I try this in my controller:
$log = $this->log_cambios_trabajadores->like('id_empresa', $id_empresa) ->with_administrador('fields: nombre, apellido_paterno, apellido_materno') ->with_trabajador('fields: nombre, control') ->get_all();
and give me the error; No method with that name (like) in MY_Model or CI_Model.
But, this works perfectly:
$log = $this->log_cambios_trabajadores->where('id_empresa', $id_empresa) ->with_administrador('fields: nombre, apellido_paterno, apellido_materno') ->with_trabajador('fields: nombre, control') ->get_all();
Can you giveme an example how apply Like and work...
My_model is AWESOME!!!
Try this;
$this->db->like('id_empresa', $id_empresa); $log = $this->log_cambios_trabajadores->with_administrador('fields: nombre, apellido_paterno, apellido_materno') ->with_trabajador('fields: nombre, control') ->get_all();
Works Perfectt!!!
Thanks!!!!!
Not at all ;)
U can use: $this->post_model->where('col_name', 'LIKE', 'keyword')->limit($per_page, $current_page)->get_all();
@saclychan thanks