function bundle_entry_count($bundle_id, $site_id = 1) { $result = $this->db->select('COUNT(id) AS row_count')->from('stash')->where('bundle_id', $bundle_id)->where('site_id', $site_id)->get(); if ($result->num_rows() == 1) { return $result->row('row_count'); } else { return 0; } }