php - codeigniter find by library? -
is there codeigniter plugin allows me create find functions without writing code on every field in db table?
i find myself writing lot of functions tables such findbyid findbyfirstname findbyemail , on, libraries written speedup dev time? tried googling havent come across any.
if mean have write multiple methods in model find rows in table specific field, pass associative array containing fields , values want search generic function - like:
function search_mytable($search=array()) { $this->db->select('mytable.*'); $this->db->from('mytable'); if(!empty($search) $this->db->where($search); }
there's more information can pass ci active record method here http://codeigniter.com/user_guide/database/active_record.html#select
Comments
Post a Comment