Database Error

Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') )) OR (`Client`.`id` IN (select distinct(id) from agd_clients as Client ' at line 7

SQL Query: SELECT `Client`.`id`, `Client`.`category_id` FROM `indexeg_new2014`.`agd_clients` AS `Client` WHERE `Client`.`category_id` IS NULL AND ((`Client`.`id` IN (select distinct(client_id) from agd_branches as Branch where `Branch`.`region_id` in (SELECT `r1`.`id` FROM agd_regions r1 JOIN agd_regions r2 ON `r1`.`lft` >= `r2`.`lft` AND `r1`.`rght` <= `r2`.`rght` WHERE `r2`.`id` = ) )) OR (`Client`.`id` IN (select distinct(id) from agd_clients as Client where `Client`.`company_name` like '%%' or `Client`.`business_field` like '%%' or `Client`.`keywords` like '%%' or `Client`.`id` in (SELECT DISTINCT(foreign_key) FROM agd_i18n as I18n WHERE content LIKE '%%' and model='Client')))) GROUP BY `Client`.`category_id`

Notice: If you want to customize this error message, create app/View/Errors/pdo_error.ctp

Stack Trace

  • CORE/Cake/Model/Datasource/DboSource.php line 460PDOStatement->execute(array)
  • CORE/Cake/Model/Datasource/DboSource.php line 426DboSource->_execute(string, array)
  • CORE/Cake/Model/Datasource/DboSource.php line 666DboSource->execute(string, array, array)
  • CORE/Cake/Model/Datasource/DboSource.php line 1077DboSource->fetchAll(string, boolean)
  • CORE/Cake/Model/Model.php line 2750DboSource->read(Client, array)
  • CORE/Cake/Model/Model.php line 2722Model->_readDataSource(string, array)
  • [internal function]Model->find(string, array)
  • APP/Plugin/Croogo/Model/CroogoAppModel.php line 81call_user_func_array(array, array)
  • APP/Plugin/Indexeg/Controller/ClientsController.php line 290CroogoAppModel->find(string, array)
  • APP/Plugin/Indexeg/Controller/ClientsController.php line 197ClientsController->_advancedSearch(integer, null, null, null, null, null)
  • [internal function]ClientsController->search(string, string, string, string)
  • CORE/Cake/Controller/Controller.php line 490ReflectionMethod->invokeArgs(ClientsController, array)
  • CORE/Cake/Routing/Dispatcher.php line 187Controller->invokeAction(CakeRequest)
  • CORE/Cake/Routing/Dispatcher.php line 162Dispatcher->_invoke(ClientsController, CakeRequest, CakeResponse)
  • APP/webroot/index.php line 96Dispatcher->dispatch(CakeRequest, CakeResponse)