mysqli_sql_exception mysqli_sql_exception

HTTP 500 Whoops, looks like something went wrong.

No database selected

Exceptions 2

mysqli_sql_exception

Show exception properties
mysqli_sql_exception {#947
  #sqlstate: "3D000"
}
  1. $this->connection = $connection;
  2. $this->query = $query;
  3. $query = $this->prepareParameterKeyMapping($query);
  4. $this->statement = $connection->prepare($query);
  5. if (!$this->statement) {
  6. throw new PrepareStatementFailureException($this->connection->error, $this->connection->errno);
  7. }
  8. }
  1. $this->connection = $connection;
  2. $this->query = $query;
  3. $query = $this->prepareParameterKeyMapping($query);
  4. $this->statement = $connection->prepare($query);
  5. if (!$this->statement) {
  6. throw new PrepareStatementFailureException($this->connection->error, $this->connection->errno);
  7. }
  8. }
  1. * @since 2.0.0
  2. * @throws PrepareStatementFailureException
  3. */
  4. protected function prepareStatement(string $query): StatementInterface
  5. {
  6. return new MysqliStatement($this->connection, $query);
  7. }
  8. /**
  9. * Unlocks tables in the database.
  10. *
  1. $query->setLimit($limit, $offset);
  2. $sql = $this->replacePrefix((string) $query);
  3. $this->statement = $this->prepareStatement($sql);
  4. $this->sql = $query;
  5. $this->limit = (int) max(0, $limit);
  6. $this->offset = (int) max(0, $offset);
  1. $db->quoteName('e.element') . ' = ' . $db->quoteName('s.template')
  2. . ' AND ' . $db->quoteName('e.type') . ' = ' . $db->quote('template')
  3. . ' AND ' . $db->quoteName('e.client_id') . ' = ' . $db->quoteName('s.client_id')
  4. );
  5. $db->setQuery($query);
  6. return $db->loadObjectList('id');
  7. }
  8. /**
  1. if ($cache->contains($cacheId)) {
  2. $templates = $cache->get($cacheId);
  3. } else {
  4. $templates = $this->bootComponent('templates')->getMVCFactory()
  5. ->createModel('Style', 'Administrator')->getSiteTemplates();
  6. foreach ($templates as &$template) {
  7. // Create home element
  8. if ($template->home == 1 && !isset($template_home) || $this->getLanguageFilter() && $template->home == $tag) {
  9. $template_home = clone $template;
  1. public function render(\Throwable $error): string
  2. {
  3. $app = Factory::getApplication();
  4. // Get the current template from the application
  5. $template = $app->getTemplate(true);
  6. // Push the error object into the document
  7. $this->getDocument()->setError($error);
  8. // Add registry file for the template asset
  1. 'subject' => $app,
  2. 'document' => $renderer->getDocument(),
  3. ])
  4. );
  5. $data = $renderer->render($error);
  6. // If nothing was rendered, just use the message from the Exception
  7. if (empty($data)) {
  8. $data = $error->getMessage();
  9. }
  1. * @since 3.10.0
  2. */
  3. public static function handleException(\Throwable $error)
  4. {
  5. static::logException($error);
  6. static::render($error);
  7. }
  8. /**
  9. * Render the error page based on an exception.
  10. *
  1. );
  2. // Trigger the onError event.
  3. $this->dispatchEvent('onError', $event);
  4. ExceptionHandler::handleException($event->getError());
  5. }
  6. // Trigger the onBeforeRespond event.
  7. $this->dispatchEvent(
  8. 'onBeforeRespond',
  1. // Set the application as global app
  2. \Joomla\CMS\Factory::$application = $app;
  3. // Execute the application.
  4. $app->execute();
require_once('/home/forge/demo-next.jreviews.com/public/includes/app.php') in /home/forge/demo-next.jreviews.com/public/index.php (line 32)
  1. * define() is used rather than "const" to not error for PHP 5.2 and lower
  2. */
  3. define('_JEXEC', 1);
  4. // Run the application - All executable code should be triggered through this file
  5. require_once __DIR__ . '/includes/app.php';

mysqli_sql_exception

Unknown database 'next'

  1. if (!$database) {
  2. return false;
  3. }
  4. if (!$this->connection->select_db($database)) {
  5. throw new ConnectionFailureException('Could not connect to database.');
  6. }
  7. return true;
  8. }
  1. if (!$database) {
  2. return false;
  3. }
  4. if (!$this->connection->select_db($database)) {
  5. throw new ConnectionFailureException('Could not connect to database.');
  6. }
  7. return true;
  8. }
  1. // And read the real sql mode to mitigate changes in mysql > 5.7.+
  2. $this->options['sqlModes'] = explode(',', $this->setQuery('SELECT @@SESSION.sql_mode;')->loadResult());
  3. // If auto-select is enabled select the given database.
  4. if ($this->options['select'] && !empty($this->options['database'])) {
  5. $this->select($this->options['database']);
  6. }
  7. $this->mariadb = stripos($this->connection->server_info, 'mariadb') !== false;
  8. $this->utf8mb4 = $this->serverClaimsUtf8mb4Support();
  1. if (\is_float($text)) {
  2. // Force the dot as a decimal point.
  3. return str_replace(',', '.', (string) $text);
  4. }
  5. $this->connect();
  6. $result = $this->connection->real_escape_string((string) $text);
  7. if ($extra) {
  8. $result = addcslashes($result, '%_');
  1. }
  2. return $text;
  3. }
  4. return '\'' . ($escape ? $this->escape($text) : $text) . '\'';
  5. }
  6. /**
  7. * Quotes a binary string to database requirements for use in database queries.
  8. *
  1. )
  2. ->join(
  3. 'LEFT',
  4. $db->quoteName('#__extensions', 'e'),
  5. $db->quoteName('e.element') . ' = ' . $db->quoteName('s.template')
  6. . ' AND ' . $db->quoteName('e.type') . ' = ' . $db->quote('template')
  7. . ' AND ' . $db->quoteName('e.client_id') . ' = ' . $db->quoteName('s.client_id')
  8. );
  9. $db->setQuery($query);
  1. if ($cache->contains($cacheId)) {
  2. $templates = $cache->get($cacheId);
  3. } else {
  4. $templates = $this->bootComponent('templates')->getMVCFactory()
  5. ->createModel('Style', 'Administrator')->getSiteTemplates();
  6. foreach ($templates as &$template) {
  7. // Create home element
  8. if ($template->home == 1 && !isset($template_home) || $this->getLanguageFilter() && $template->home == $tag) {
  9. $template_home = clone $template;
  1. 'phpVersion' => PHP_VERSION,
  2. 'joomlaVersion' => JVERSION,
  3. 'requestId' => $this->requestId,
  4. 'identity' => $this->getIdentityInfo($application->getIdentity()),
  5. 'response' => $this->getResponseInfo($application->getResponse()),
  6. 'template' => $this->getTemplateInfo($application->getTemplate(true)),
  7. 'database' => $this->getDatabaseInfo($model->getInfo()),
  8. ];
  9. }
  10. /**
  1. $request_variables
  2. )
  3. );
  4. foreach ($this->collectors as $name => $collector) {
  5. $this->data[$name] = $collector->collect();
  6. }
  7. // Remove all invalid (non UTF-8) characters
  8. array_walk_recursive($this->data, function (&$item) {
  9. if (is_string($item) && !mb_check_encoding($item, 'UTF-8')) {
  1. * @return array
  2. */
  3. public function getData()
  4. {
  5. if ($this->data === null) {
  6. $this->collect();
  7. }
  8. return $this->data;
  9. }
  10. /**
  1. $js .= $this->getAddDatasetCode($id, $data, '(stacked)');
  2. }
  3. }
  4. $suffix = !$initialize ? '(ajax)' : null;
  5. $js .= $this->getAddDatasetCode($this->debugBar->getCurrentRequestId(), $this->debugBar->getData(), $suffix);
  6. $nonce = '';
  7. if ($doc->cspNonce) {
  8. $nonce = ' nonce="' . $doc->cspNonce . '"';
  1. echo $contents;
  2. return;
  3. }
  4. echo str_replace('</body>', $debugBarRenderer->renderHead() . $debugBarRenderer->render() . '</body>', $contents);
  5. }
  6. /**
  7. * AJAX handler
  8. *
  1. foreach ($this->listeners[$event->getName()] as $listener) {
  2. if ($event->isStopped()) {
  3. return $event;
  4. }
  5. $listener($event);
  6. }
  7. }
  8. return $event;
  9. }
  1. if ($this->profiler) {
  2. $this->profiler->mark('afterCache');
  3. }
  4. $this->getDispatcher()->dispatch('onAfterRespond', new AfterRespondEvent(
  5. 'onAfterRespond',
  6. [
  7. 'subject' => $app,
  8. ]
  9. ));
  1. foreach ($this->listeners[$event->getName()] as $listener) {
  2. if ($event->isStopped()) {
  3. return $event;
  4. }
  5. $listener($event);
  6. }
  7. }
  8. return $event;
  9. }
  1. $dispatcher = $this->getDispatcher();
  2. } catch (\UnexpectedValueException $exception) {
  3. return null;
  4. }
  5. return $dispatcher->dispatch($eventName, $event ?: new ApplicationEvent($eventName, $this));
  6. }
  7. /**
  8. * Method to run the application routines.
  9. *
  1. $this->input->def($key, $value);
  2. }
  3. // Trigger the onAfterRoute event.
  4. PluginHelper::importPlugin('system', null, true, $this->getDispatcher());
  5. $this->dispatchEvent(
  6. 'onAfterRoute',
  7. new AfterRouteEvent('onAfterRoute', ['subject' => $this])
  8. );
  9. $Itemid = $this->input->getInt('Itemid', null);
  1. // Mark afterInitialise in the profiler.
  2. JDEBUG ? $this->profiler->mark('afterInitialise') : null;
  3. // Route the application
  4. $this->route();
  5. // Mark afterRoute in the profiler.
  6. JDEBUG ? $this->profiler->mark('afterRoute') : null;
  7. if (!$this->isHandlingMultiFactorAuthentication()) {
  1. $this->sanityCheckSystemVariables();
  2. $this->setupLogging();
  3. $this->createExtensionNamespaceMap();
  4. // Perform application routines.
  5. $this->doExecute();
  6. // If we have an application document object, render it.
  7. if ($this->document instanceof \Joomla\CMS\Document\Document) {
  8. // Render the application output.
  9. $this->render();
  1. // Set the application as global app
  2. \Joomla\CMS\Factory::$application = $app;
  3. // Execute the application.
  4. $app->execute();
require_once('/home/forge/demo-next.jreviews.com/public/includes/app.php') in /home/forge/demo-next.jreviews.com/public/index.php (line 32)
  1. * define() is used rather than "const" to not error for PHP 5.2 and lower
  2. */
  3. define('_JEXEC', 1);
  4. // Run the application - All executable code should be triggered through this file
  5. require_once __DIR__ . '/includes/app.php';

Stack Traces 2

[2/2] mysqli_sql_exception
mysqli_sql_exception:
No database selected

  at /home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:138
  at mysqli->prepare()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:138)
  at Joomla\Database\Mysqli\MysqliStatement->__construct()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:972)
  at Joomla\Database\Mysqli\MysqliDriver->prepareStatement()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/DatabaseDriver.php:1780)
  at Joomla\Database\DatabaseDriver->setQuery()
     (/home/forge/demo-next.jreviews.com/public/administrator/components/com_templates/src/Model/StyleModel.php:716)
  at Joomla\Component\Templates\Administrator\Model\StyleModel->getSiteTemplates()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Application/SiteApplication.php:460)
  at Joomla\CMS\Application\SiteApplication->getTemplate()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Error/Renderer/HtmlRenderer.php:50)
  at Joomla\CMS\Error\Renderer\HtmlRenderer->render()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Exception/ExceptionHandler.php:136)
  at Joomla\CMS\Exception\ExceptionHandler::render()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Exception/ExceptionHandler.php:73)
  at Joomla\CMS\Exception\ExceptionHandler::handleException()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Application/CMSApplication.php:334)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/home/forge/demo-next.jreviews.com/public/includes/app.php:58)
  at require_once('/home/forge/demo-next.jreviews.com/public/includes/app.php')
     (/home/forge/demo-next.jreviews.com/public/index.php:32)                
[1/2] mysqli_sql_exception
mysqli_sql_exception:
Unknown database 'next'

  at /home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:786
  at mysqli->select_db()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:786)
  at Joomla\Database\Mysqli\MysqliDriver->select()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:263)
  at Joomla\Database\Mysqli\MysqliDriver->connect()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:345)
  at Joomla\Database\Mysqli\MysqliDriver->escape()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/database/src/DatabaseDriver.php:1467)
  at Joomla\Database\DatabaseDriver->quote()
     (/home/forge/demo-next.jreviews.com/public/administrator/components/com_templates/src/Model/StyleModel.php:712)
  at Joomla\Component\Templates\Administrator\Model\StyleModel->getSiteTemplates()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Application/SiteApplication.php:460)
  at Joomla\CMS\Application\SiteApplication->getTemplate()
     (/home/forge/demo-next.jreviews.com/public/plugins/system/debug/src/DataCollector/InfoCollector.php:135)
  at Joomla\Plugin\System\Debug\DataCollector\InfoCollector->collect()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/php-debugbar/php-debugbar/src/DebugBar/DebugBar.php:238)
  at DebugBar\DebugBar->collect()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/php-debugbar/php-debugbar/src/DebugBar/DebugBar.php:265)
  at DebugBar\DebugBar->getData()
     (/home/forge/demo-next.jreviews.com/public/plugins/system/debug/src/JavascriptRenderer.php:119)
  at Joomla\Plugin\System\Debug\JavascriptRenderer->render()
     (/home/forge/demo-next.jreviews.com/public/plugins/system/debug/src/Extension/Debug.php:379)
  at Joomla\Plugin\System\Debug\Extension\Debug->onAfterRespond()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/event/src/Dispatcher.php:454)
  at Joomla\Event\Dispatcher->dispatch()
     (/home/forge/demo-next.jreviews.com/public/plugins/system/cache/src/Extension/Cache.php:194)
  at Joomla\Plugin\System\Cache\Extension\Cache->onAfterRoute()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/event/src/Dispatcher.php:454)
  at Joomla\Event\Dispatcher->dispatch()
     (/home/forge/demo-next.jreviews.com/public/libraries/vendor/joomla/application/src/AbstractApplication.php:99)
  at Joomla\Application\AbstractApplication->dispatchEvent()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Application/SiteApplication.php:811)
  at Joomla\CMS\Application\SiteApplication->route()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Application/SiteApplication.php:243)
  at Joomla\CMS\Application\SiteApplication->doExecute()
     (/home/forge/demo-next.jreviews.com/public/libraries/src/Application/CMSApplication.php:304)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/home/forge/demo-next.jreviews.com/public/includes/app.php:58)
  at require_once('/home/forge/demo-next.jreviews.com/public/includes/app.php')
     (/home/forge/demo-next.jreviews.com/public/index.php:32)