I am newbie to php I need help I want to add where clause to this 'get_select_option'
my get_select_option code is here
function get_select_option($table,$id,$name,$selected=0){
$query = $this->db->get($table);
$select = '<option value="">SELECT</option>';
if($query->num_rows()>0){
foreach($query->result_array() as $row){
$selected_option = ($selected==$row[$id]) ? ' selected="selected" ':' ';
$select.='<option value="'.$row[$id].'" '. $selected_option.'>'.trim(strtoupper($row[$name])).'</option>';
}
}
return $select;
}