Can I use $db->func with select query and where condition
Hi,
Am i able to use $db->func with select query?
$cols = Array ("emplyee_idno", "employee_name", "employee_rank","employee_dept",{$this->db->func('hex(employee_uid'))});
$employees = $this->db->get("employees",null,$cols);
Getting error for select query
Notice: Array to string conversion
Getting error for where condition
$this->db->where("employee_uid",$this->db->func("unhex($empid)));
Warning: mysqli_stmt::bind_param(): Invalid type or no types specified in MysqliDb.php on line 1588
When I echo query SELECT emplyee_idno, employee_name, employee_rank, employee_dept, '.Array.' FROM employees
Hey @adildils , did you manage to work around this somehow? I'm hitting the same problem.
func() should be used in insert or update statements. In where and get() you can specify functions as a string
$cols = Array ("hex(emplyee_idno) as employee_uid ", "employee_name", "employee_rank","employee_dept",$employees = $this->db->get("employees",null,$cols);