php - How to use count method with my_model -
i'm trying work jamie rumbelow's my_model , i'm running issue figuring out how can use count method array.
i want count total number of personal unread messages logged user has received.
so going try following call:
$unread_messages = $this->personal_messsages->count_by();
however, need pass in user_id
of user , integer know if message unread or read.
any ideas on how perform this?
unfortunately, count_by() works off single field & value, not array (unless he's updated). you'll have write own this
have @ link see examples of my_model functions: http://codebyjeff.com/blog/2012/01/using-jamie-rumbelows-my_model
edit: may stand corrected on one: try passing in array('user_id'=>$user_id, 'status'=>1); (adjusted own values), may work
Comments
Post a Comment