Error:
SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation '='
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php
toggle arguments
|
$connection = $this->_driver->connection(); |
|
|
|
try { |
|
$connection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, $this->_bufferResults); |
|
$result = $this->_statement->execute($params); |
|
} finally { |
|
$connection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); |
|
} |
|
|
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Database/Connection.php
toggle arguments
|
public function run(Query $query) |
|
{ |
|
$statement = $this->prepare($query); |
|
$query->getValueBinder()->attachTo($statement); |
|
$statement->execute(); |
|
|
|
return $statement; |
|
} |
|
|
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Database/Query.php
toggle arguments
|
* @return \Cake\Database\StatementInterface |
|
*/ |
|
public function execute() |
|
{ |
|
$statement = $this->_connection->run($this); |
|
$typeMap = $this->getSelectTypeMap(); |
|
|
|
if ($typeMap->toArray() && $this->_typeCastAttached === false) { |
|
$driver = $this->_connection->getDriver(); |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/ORM/Query.php
toggle arguments
|
|
|
return new $decorator($this->_results); |
|
} |
|
|
|
$statement = $this->getEagerLoader()->loadExternal($this, $this->execute()); |
|
|
|
return new ResultSet($this, $statement); |
|
} |
|
|
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php
toggle arguments
|
if ($this->_cache) { |
|
$results = $this->_cache->fetch($this); |
|
} |
|
if (!isset($results)) { |
|
$results = $this->_decorateResults($this->_execute()); |
|
if ($this->_cache) { |
|
$this->_cache->store($this, $results); |
|
} |
|
} |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/ORM/Query.php
toggle arguments
|
'You cannot call all() on a non-select query. Use execute() instead.' |
|
); |
|
} |
|
|
|
return $this->_all(); |
|
} |
|
|
|
/** |
|
* Trigger the beforeFind event on the query's repository object. |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Datasource/Paginator.php
toggle arguments
|
$query->applyOptions($options); |
|
} |
|
|
|
$cleanQuery = clone $query; |
|
$results = $query->all(); |
|
$numResults = count($results); |
|
$count = $cleanQuery->count(); |
|
|
|
$page = $options['page']; |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php
toggle arguments
|
$request = $this->_registry->getController()->request; |
|
|
|
try { |
|
$results = $this->_paginator->paginate( |
|
$object, |
|
$request->getQueryParams(), |
|
$settings |
|
); |
|
|
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Controller/Controller.php
toggle arguments
|
throw new RuntimeException('Unable to locate an object compatible with paginate.'); |
|
} |
|
$settings += $this->paginate; |
|
|
|
return $this->Paginator->paginate($table, $settings); |
|
} |
|
|
|
/** |
|
* Method to check that an action is accessible from a URL. |
/var/www/drishtiias.com/public_html/src/Controller/BlogsController.php
toggle arguments
|
// 'conditions'=>array('blogs.blog_id=bv.blog_id'), |
|
// ) |
|
), |
|
'fields'=>array('articleauthor'=>'blogs.articleauthor','blog_id'=>'blogs.blog_id','title'=>'blogs.title','publishdate'=>'blogs.publishdate','posturl'=>'blogs.posturl','featuredimage'=>'blogs.featuredimage','description'=>'blogs.description','name'=>'bc.name','caturl'=>'bc.posturl'), |
|
'conditions'=>array('blogs.status'=>'1',$conditions),'group'=>'blogs.blog_id','limit'=>FORNTEND_PAGING))->toArray(); |
|
$this->set('blogs',$query); |
|
if(sizeof($query)>0){ |
|
// $blogvisits=TableRegistry::get('blogvisits'); |
|
// $visits=$blogvisits->find('all',array('conditions'=>array('blog_id'=>$query[0]['blog_id'],'remoteip'=>$_SERVER['REMOTE_ADDR'])))->toArray(); |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Controller/Controller.php
toggle arguments
|
} |
|
/* @var callable $callable */ |
|
$callable = [$this, $request->getParam('action')]; |
|
|
|
return $callable(...array_values($request->getParam('pass'))); |
|
} |
|
|
|
/** |
|
* Merge components, helpers vars from |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php
toggle arguments
|
if ($result instanceof Response) { |
|
return $result; |
|
} |
|
|
|
$response = $controller->invokeAction(); |
|
if ($response !== null && !($response instanceof Response)) { |
|
throw new LogicException('Controller actions can only return Cake\Http\Response or null.'); |
|
} |
|
|
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php
toggle arguments
|
} else { |
|
$controller = $this->factory->create($request, $response); |
|
} |
|
|
|
$response = $this->_invoke($controller); |
|
if (isset($request->params['return'])) { |
|
return $response; |
|
} |
|
|
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/BaseApplication.php
toggle arguments
|
* @return \Psr\Http\Message\ResponseInterface |
|
*/ |
|
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next) |
|
{ |
|
return $this->getDispatcher()->dispatch($request, $response); |
|
} |
|
|
|
/** |
|
* Get the ActionDispatcher. |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/Runner.php
toggle arguments
|
$next = $this->middleware->get($this->index); |
|
if ($next) { |
|
$this->index++; |
|
|
|
return $next($request, $response, $this); |
|
} |
|
|
|
// End of the queue |
|
return $response; |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php
toggle arguments
|
); |
|
} |
|
$matching = Router::getRouteCollection()->getMiddleware($middleware); |
|
if (!$matching) { |
|
return $next($request, $response); |
|
} |
|
$matching[] = $next; |
|
$middleware = new MiddlewareQueue($matching); |
|
$runner = new Runner(); |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/Runner.php
toggle arguments
|
$next = $this->middleware->get($this->index); |
|
if ($next) { |
|
$this->index++; |
|
|
|
return $next($request, $response, $this); |
|
} |
|
|
|
// End of the queue |
|
return $response; |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php
toggle arguments
|
public function __invoke($request, $response, $next) |
|
{ |
|
$url = $request->getUri()->getPath(); |
|
if (strpos($url, '..') !== false || strpos($url, '.') === false) { |
|
return $next($request, $response); |
|
} |
|
|
|
if (strpos($url, '/.') !== false) { |
|
return $next($request, $response); |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/Runner.php
toggle arguments
|
$next = $this->middleware->get($this->index); |
|
if ($next) { |
|
$this->index++; |
|
|
|
return $next($request, $response, $this); |
|
} |
|
|
|
// End of the queue |
|
return $response; |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php
toggle arguments
|
*/ |
|
public function __invoke($request, $response, $next) |
|
{ |
|
try { |
|
return $next($request, $response); |
|
} catch (Throwable $exception) { |
|
return $this->handleException($exception, $request, $response); |
|
} catch (Exception $exception) { |
|
return $this->handleException($exception, $request, $response); |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/Runner.php
toggle arguments
|
$next = $this->middleware->get($this->index); |
|
if ($next) { |
|
$this->index++; |
|
|
|
return $next($request, $response, $this); |
|
} |
|
|
|
// End of the queue |
|
return $response; |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/Runner.php
toggle arguments
|
{ |
|
$this->middleware = $middleware; |
|
$this->index = 0; |
|
|
|
return $this->__invoke($request, $response); |
|
} |
|
|
|
/** |
|
* @param \Psr\Http\Message\ServerRequestInterface $request The server request |
/var/www/drishtiias.com/public_html/vendor/cakephp/cakephp/src/Http/Server.php
toggle arguments
|
throw new RuntimeException('The application `middleware` method did not return a middleware queue.'); |
|
} |
|
$this->dispatchEvent('Server.buildMiddleware', ['middleware' => $middleware]); |
|
$middleware->add($this->app); |
|
$response = $this->runner->run($middleware, $request, $response); |
|
|
|
if (!($response instanceof ResponseInterface)) { |
|
throw new RuntimeException(sprintf( |
|
'Application did not create a response. Got "%s" instead.', |
/var/www/drishtiias.com/public_html/webroot/index.php
toggle arguments
|
// Bind your application to the server. |
|
$server = new Server(new Application(dirname(__DIR__) . '/config')); |
|
|
|
// Run the request/response through the application and emit the response. |
|
$server->emit($server->run()); |
|
|
If you are using SQL keywords as table column names, you can enable identifier
quoting for your database connection in config/app.php.
Could this be caused by using Auto-Tables?
Some of the Table objects in your application were created by instantiating "Cake\ORM\Table"
instead of any other specific subclass.
This could be the cause for this exception. Auto-Tables are created for you under the following circumstances:
- The class for the specified table does not exist.
- The Table was created with a typo: TableRegistry::get('Atricles');
- The class file has a typo in the name or incorrect namespace: class Atricles extends Table
- The file containing the class has a typo or incorrect casing: Atricles.php
- The Table was used using associations but the association has a typo: $this->belongsTo('Atricles')
- The table class resides in a Plugin but no plugin notation was used in the association definition.
Please try correcting the issue for the following table aliases:
- articlenote
- bookmarkprogress
If you want to customize this error message, create
src/Template/Error/pdo_error.ctp