{"record":{"id":"92f175eae3efd982","repo":"bcit-ci/CodeIgniter","slug":"s-expects-values-to-be-a-non-empty-array","errorCode":null,"errorMessage":"%s() expects $values to be a non-empty array","messagePattern":"(.+?)\\(\\) expects \\$values to be a non-empty array","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"system/database/DB_query_builder.php","lineNumber":885,"sourceCode":"\t * @param\tstring\t$key\tThe field to search\n\t * @param\tarray\t$values\tThe values searched on\n\t * @param\tbool\t$not\tIf the statement would be IN or NOT IN\n\t * @param\tstring\t$type\n\t * @param\tbool\t$escape\n\t * @return\tCI_DB_query_builder\n\t */\n\tprotected function _wh_in($qb_key, $key, array $values, $not = FALSE, $type = 'AND ', $escape = NULL)\n\t{\n\t\t$qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where';\n\n\t\tif (empty($key) OR ! is_string($key))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(sprintf('%s() expects $key to be a non-empty string', debug_backtrace(0, 2)[1]['function']));\n\t\t}\n\n\t\tif (empty($values))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(sprintf('%s() expects $values to be a non-empty array', debug_backtrace(0, 2)[1]['function']));\n\t\t}\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\t$not = ($not) ? ' NOT' : '';\n\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$wh_in = array();\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$wh_in[] = $this->escape($value);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$wh_in = array_values($values);\n\t\t}","sourceCodeStart":867,"sourceCodeEnd":903,"githubUrl":"https://github.com/bcit-ci/CodeIgniter/blob/3658d731eaabe6117298a105ffb5b9dd59e190ce/system/database/DB_query_builder.php#L867-L903","documentation":"Error \"%s() expects $values to be a non-empty array\" thrown in bcit-ci/CodeIgniter.","triggerScenarios":"Thrown at system/database/DB_query_builder.php:885 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3658d731eaabe6117298a105ffb5b9dd59e190ce","analyzedAt":"2026-08-17T02:34:56.929Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}