42000!

Fuel\Core\Database_Exception [ 42000 ]:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 ')' at line 1 with query: "SELECT DISTINCT (product_to_categories.product_id) as product_id FROM `product_to_categories` WHERE `category_id` IN ()"

COREPATH/classes/database/pdo/connection.php @ line 253

248                            {
249                                $error_code 0;
250                            }
251                        }
252
253                        throw new \Database_Exception($e->getMessage().' with query: "'.$sql.'"'$error_code$e);
254                    }
255                }
256
257                // no more attempts left, bail out
258                else

Backtrace

  1. APPPATH/core/query.php @ line 78
    73            catch (CacheNotFoundException $e) {}
    74        }
    75
    76        // Execute the query
    77        \DB::$query_count++;
    78        $result $db->query($this->_type$sql$this->_as_object);
    79
    80        // Cache the result if needed
    81        if (isset($cache) and ($this->_cache_all or $result->count()))
    82        {
    83            $cache->set_expiration($this->_lifetime)->set_contents($result->as_array())->set();
    
  2. COREPATH/classes/model/crud.php @ line 242
    237            }
    238        }
    239
    240        static::pre_find($query);
    241
    242        $result =  $query->execute(static::get_connection());
    243        $result = ($result->count() === 0) ? null $result->as_array($key);
    244
    245        return static::post_find($result);
    246    }
    247
    
  3. APPPATH/modules/product/classes/controller/category.php @ line 1773
    1768                    //if(!$viewall)$query->order_by('product_to_categories.sort', 'asc');
    1769                    //else $query->order_by('product.sort', 'asc');
    1770                    //$query->limit($perPage);
    1771                    //$query->offset($start_no);
    1772                    return $query;
    1773            },'product_id');
    1774
    1775            if($category_product_ids)
    1776            {
    1777                $product_ids implode(','array_keys($category_product_ids));
    1778
    
  4. APPPATH/modules/product/classes/controller/category.php @ line 81
    76
    77                if($category === null){
    78                    throw new \HttpNotFoundException;
    79                }
    80
    81                $products $this->fetch_ordered_products($category->id'',$viewall$start_seq$per_page);
    82
    83
    84                if($category === null){
    85                    throw new \HttpNotFoundException;
    86                }
    
  5. COREPATH/base56.php @ line 37
    32                $args array_values($args);
    33            }
    34
    35            list($instance$method) = $callback;
    36
    37            return $instance->{$method}(...$args);
    38        }
    39
    40        // static call?
    41        elseif (is_array($callback) and isset($callback[1]) and is_string($callback[0]))
    42        {
    
  6. COREPATH/classes/controller/hybrid.php @ line 81
    76        }
    77
    78        // check if the action method exists
    79        if (method_exists($this$controller_method))
    80        {
    81            return call_fuel_func_array(array($this$controller_method), $arguments);
    82        }
    83
    84        // if not, we got ourselfs a genuine 404!
    85        throw new \HttpNotFoundException();
    86    }
    
  7. COREPATH/classes/request.php @ line 454
    449                    // fire any controller started events
    450                    \Event::instance()->has_events('controller_started') and \Event::instance()->trigger('controller_started''''none');
    451
    452                    $class->hasMethod('before') and $class->getMethod('before')->invoke($this->controller_instance);
    453
    454                    $response $action->invokeArgs($this->controller_instance$this->method_params);
    455
    456                    $class->hasMethod('after') and $response $class->getMethod('after')->invoke($this->controller_instance$response);
    457
    458                    // fire any controller finished events
    459                    \Event::instance()->has_events('controller_finished') and \Event::instance()->trigger('controller_finished''''none');
    
  8. DOCROOT/index.php @ line 116
    111                $response Response::forge($response);
    112            }
    113        }
    114        elseif ($e === false)
    115        {
    116            $response Request::forge()->execute()->response();
    117        }
    118        elseif ($route)
    119        {
    120            $response Request::forge($routefalse)->execute(array($e))->response();
    121        }
    
  9. DOCROOT/index.php @ line 138
    133
    134        // Boot the app...
    135        require APPPATH.'bootstrap.php';
    136
    137        // ... and execute the main request
    138        $response $routerequest();
    139    }
    140    catch (HttpBadRequestException $e)
    141    {
    142        $response $routerequest('_400_'$e);
    143    }