Welcome Guest, Not a member yet? Register   Sign In
Bug with large IN query
#4

It's actually a problem of regex. If the string gets too big it runs run into a recursion limit.

Instead of using Query Builder you might be better off using a hand-crafted query string as an argument to $this->db->query('your hand-crafted query');

Depending on how you are building the "in" list you might be able to break it down into manageable bites. Here's the basic idea.

PHP Code:
$this->db->group_start();
$ids_chunk array_chunk($all_ids250); //or whatever size can be handled
foreach($ids_chunk as $chunk)
{
    
$this->db->or_where_in('id_prod'$chunk);
}
$this->db->group_end(); 
Reply


Messages In This Thread
Bug with large IN query - by michaelv - 07-25-2018, 07:08 AM
RE: Bug with large IN query - by php_rocs - 07-25-2018, 08:10 AM
RE: Bug with large IN query - by michaelv - 07-25-2018, 08:43 AM
RE: Bug with large IN query - by dave friend - 07-25-2018, 09:15 AM
RE: Bug with large IN query - by zurtri - 07-25-2018, 04:14 PM
RE: Bug with large IN query - by michaelv - 07-26-2018, 01:18 AM
RE: Bug with large IN query - by php_rocs - 07-26-2018, 08:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB