whereNotIn query builder - empty array |
I have an issue whilst trying to exclude courses which are already stated under another heading. Using the following code i am getting the error
Code: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') Code: $this->data['valid_courses'] = $this->event->join('courses', 'courses.course_id = events.course_id')->join('events_users', 'events.event_id = events_users.event_id')->where('event_user_valid_to <=', $today)->orderBy('event_user_valid_to', 'DESC')->findAll(); As you can see the Code: $valid_courses_ids Sorry if this is something that you feel is a waste of time but It seemed qquite unusual to me. Regards, Jonsmith1982
If the array is empty, it seems the following SQL that is syntax error would be produced.
PHP Code: $names = []; https://codeigniter4.github.io/CodeIgnit...wherenotin |
Welcome Guest, Not a member yet? Register Sign In |