Please tell me how you can pass the value to the parameter:
$star = $this->input->get('star'); This code gets the number from the table and passes the value of $ star to the code above:
$this->db->join('q_rev', 'q_res.res_id = q_rev.rev_itemid', 'left'); $this->db->select_avg('rev_overall', 'overall'); $this->db->where('overall', $star); I need to make a condition that passes the value to the $ star parameter. If the obtained value of the table is from 0 to 2.4 (for example, 1.3), we transfer 1. If from 2.5 to 4.4, we transfer 2.
I try the condition below, it does not work. It takes data anyway from $ this-> db-> where ('overall', $ star);, excluding the if condition.
if($star > '0' && $star < '2.4'){ // передать $star что это 1 } if($star > '2.5' && $star < '4.4'){ // передать $star что это 2 } How can you implement? Can make another condition? Thank.
$star = 1;in the right place$star = 1;- Shadow33