bcit-ci/CodeIgniter · error · InvalidArgumentException
%s() expects $values to be a non-empty array
Error message
%s() expects $values to be a non-empty array
What it means
Error "%s() expects $values to be a non-empty array" thrown in bcit-ci/CodeIgniter.
Source
Thrown at system/database/DB_query_builder.php:885
* @param string $key The field to search
* @param array $values The values searched on
* @param bool $not If the statement would be IN or NOT IN
* @param string $type
* @param bool $escape
* @return CI_DB_query_builder
*/
protected function _wh_in($qb_key, $key, array $values, $not = FALSE, $type = 'AND ', $escape = NULL)
{
$qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where';
if (empty($key) OR ! is_string($key))
{
throw new InvalidArgumentException(sprintf('%s() expects $key to be a non-empty string', debug_backtrace(0, 2)[1]['function']));
}
if (empty($values))
{
throw new InvalidArgumentException(sprintf('%s() expects $values to be a non-empty array', debug_backtrace(0, 2)[1]['function']));
}
is_bool($escape) OR $escape = $this->_protect_identifiers;
$not = ($not) ? ' NOT' : '';
if ($escape === TRUE)
{
$wh_in = array();
foreach ($values as $value)
{
$wh_in[] = $this->escape($value);
}
}
else
{
$wh_in = array_values($values);
}View on GitHub (pinned to 3658d731ea)
When it happens
Trigger: Thrown at system/database/DB_query_builder.php:885 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of bcit-ci/CodeIgniter@3658d731ea (2026-08-17).
Data as JSON: /api/errors/92f175eae3efd982.
Report an issue: GitHub.