Welcome Guest, Not a member yet? Register   Sign In
ion_auth messing up my query
#1

Hello,

Code:
$user = $this->ion_auth->user()->row();
$this->db->where('appt_date >=', $FromAppt_Date);
$this->db->where('appt_date<=', $ToAppt_Date);
$group = 'Requester';
        if ($this->ion_auth->in_group($group)) {
            $this->db->where('department_code', $user->department_code);
        }
$query = $this->db->get('table');

Unknown column 'appt_date' in 'where clause'

SELECT `users_groups`.`group_id` as `id`, `groups`.`name`, `groups`.`description` FROM `users_groups` JOIN `groups` ON `users_groups`.`group_id`=`groups`.`id` WHERE `appt_date` >= '2017-06-12' AND `appt_date` <= '2017-06-12' AND `users_groups`.`user_id` = '1'
Above fails because query is trying to select query based on ion_table
Reply


Messages In This Thread
ion_auth messing up my query - by frocco - 06-18-2017, 11:28 AM
RE: ion_auth messing up my query - by PaulD - 06-18-2017, 12:25 PM
RE: ion_auth messing up my query - by frocco - 06-19-2017, 02:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB