Warning (2): file_put_contents(/var/www/html/app/tmp/logs/error.log): failed to open stream: Permission denied [CORE/Cake/Log/Engine/FileLog.php, line 142]
Errors - Meu Município

Database Error

Error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "AS" LINE 1: ...'Y' order by ordem, id limit 1) as video_youtube" AS (select... ^

SQL Query: SELECT "Materia"."id" AS "Materia__id", "Materia"."titulo" AS "Materia__titulo", "Materia"."datapublicacao" AS "Materia__datapublicacao", "Materia"."resumo" AS "Materia__resumo", "Materia"."texto" AS "Materia__texto", "Materia"."foto_capa" AS "Materia__foto_capa", (select reference from materia_medias where materia_id = Materia."id and deleted = 0 and tipo = 'Y' order by ordem, id limit 1) as video_youtube" AS (select reference from materia_medias where materia_id = Materia__id and deleted = 0 and tipo = 'Y' order by ordem, id limit 1) as video_youtube FROM "public"."materias" AS "Materia" LEFT JOIN "public"."users" AS "User" ON ("Materia"."user_id" = "User"."id") WHERE "Materia"."deleted" = 'FALSE' AND "Materia"."status" = 'P' AND "Materia"."datapublicacao" <= now() ORDER BY "Materia"."datapublicacao" desc LIMIT 10

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 470PDOStatement->execute(array)
  • CORE/Cake/Model/Datasource/DboSource.php line 436DboSource->_execute(string, array)
  • CORE/Cake/Model/Datasource/DboSource.php line 673DboSource->execute(string, array, array)
  • CORE/Cake/Model/Datasource/DboSource.php line 1184DboSource->fetchAll(string, boolean)
  • CORE/Cake/Model/Model.php line 3038DboSource->read(Materia, array)
  • CORE/Cake/Model/Model.php line 3010Model->_readDataSource(string, array)
  • APP/Model/Materia.php line 149Model->find(string, array)
  • APP/Controller/Eleicoes2016Controller.php line 145Materia->retornaListaUltimasMaterias(integer)
  • [internal function]Eleicoes2016Controller->explore()
  • CORE/Cake/Controller/Controller.php line 491ReflectionMethod->invokeArgs(Eleicoes2016Controller, array)
  • CORE/Cake/Routing/Dispatcher.php line 193Controller->invokeAction(CakeRequest)
  • CORE/Cake/Routing/Dispatcher.php line 167Dispatcher->_invoke(Eleicoes2016Controller, CakeRequest)
  • APP/webroot/index.php line 108Dispatcher->dispatch(CakeRequest, CakeResponse)