Jump to content

Sql_No_Cache Error


patouki

Recommended Posts

Bonjour,

 

J'obtiens cette erreur à chaque fois. Ca n'impacte pas le fonctionnement du site mais bon... c'est une erreur qui me prive de stats sur les visiteurs.

Je suis sous PHP5 chez OVH en mutualisé avec prestashop 1.6.1.0

Est-ce que vous pourriez m'aider, svp?

 

Merci.

[PrestaShopDatabaseException]

Unknown column 'id_shop' in 'where clause'

SELECT SQL_NO_CACHE `id_guest`
				FROM `ps_connections`
				WHERE `id_guest` = 0
					AND `date_add` > '2016-01-23 10:25:00'
					 AND id_shop IN (1) 
				ORDER BY `date_add` DESC LIMIT 1


at line 765 in file classes/db/Db.php

760. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
761. 		}
762. 		elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
763. 		{
764. 			if ($sql)
765. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
766. 
767. 			throw new PrestaShopDatabaseException($this->getMsgError());
768. 		}
769. 	}
770. 

    DbCore->displayError - [line 418 - classes/db/Db.php] - [1 Arguments]

    Argument [0]
    SELECT SQL_NO_CACHE `id_guest`
    				FROM `ps_connections`
    				WHERE `id_guest` = 0
    					AND `date_add` > '2016-01-23 10:25:00'
    					 AND id_shop IN (1) 
    				ORDER BY `date_add` DESC LIMIT 1

    DbCore->query - [line 669 - classes/db/Db.php] - [1 Arguments]

    Argument [0]
    SELECT SQL_NO_CACHE `id_guest`
    				FROM `ps_connections`
    				WHERE `id_guest` = 0
    					AND `date_add` > '2016-01-23 10:25:00'
    					 AND id_shop IN (1) 
    				ORDER BY `date_add` DESC LIMIT 1

    DbCore->getRow - [line 135 - classes/Connection.php] - [2 Arguments]

    130. 				FROM `'._DB_PREFIX_.'connections`
    131. 				WHERE `id_guest` = '.(int)$cookie->id_guest.'
    132. 					AND `date_add` > \''.pSQL(date('Y-m-d H:i:00', time() - 1800)).'\'
    133. 					'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
    134. 				ORDER BY `date_add` DESC';
    135. 		$result = Db::getInstance()->getRow($sql, false);
    136. 		if (!$result['id_guest'] && (int)$cookie->id_guest)
    137. 		{
    138. 			// The old connections details are removed from the database in order to spare some memory
    139. 			Connection::cleanConnectionsPages();
    140. 

    ConnectionCore::setNewConnection - [line 85 - classes/Connection.php] - [1 Arguments]

    80. 	public static function setPageConnection($cookie, $full = true)
    81. 	{
    82. 		$id_page = false;
    83. 		// The connection is created if it does not exist yet and we get the current page id
    84. 		if (!isset($cookie->id_connections) || !strstr(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', Tools::getHttpHost(false, false)))
    85. 			$id_page = Connection::setNewConnection($cookie);
    86. 		// If we do not track the pages, no need to get the page id
    87. 		if (!Configuration::get('PS_STATSDATA_PAGESVIEWS') && !Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS'))
    88. 			return array();
    89. 		if (!$id_page)
    90. 			$id_page = Page::getCurrentId();

    ConnectionCore::setPageConnection - [line 104 - modules/statsdata/statsdata.php] - [1 Arguments]

    99. 				</script>';
    100. 			}
    101. 		}
    102. 
    103. 		// Record the guest path then increment the visit counter of the page
    104. 		$token_array = Connection::setPageConnection($params['cookie']);
    105. 		ConnectionsSource::logHttpReferer();
    106. 		if (Configuration::get('PS_STATSDATA_PAGESVIEWS'))
    107. 			Page::setPageViewed($token_array['id_page']);
    108. 
    109. 		if (Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS'))

    StatsData->hookFooter - [line 569 - classes/Hook.php] - [1 Arguments]

    564. 				Module::$_log_modules_perfs_session = mt_rand();
    565. 		}
    566. 
    567. 		// Immediately return the result if we do not log performances
    568. 		if (!Module::$_log_modules_perfs)
    569. 			return $module->{$method}($params);
    570. 
    571. 		// Store time and memory before and after hook call and save the result in the database
    572. 		$time_start = microtime(true);
    573. 		$memory_start = memory_get_usage(true);
    574. 

    HookCore::coreCallHook - [line 526 - classes/Hook.php] - [3 Arguments]

    521. 
    522. 				// Call hook method
    523. 				if ($hook_callable)
    524. 					$display = Hook::coreCallHook($moduleInstance, 'hook'.$hook_name, $hook_args);
    525. 				elseif ($hook_retro_callable)
    526. 					$display = Hook::coreCallHook($moduleInstance, 'hook'.$retro_hook_name, $hook_args);
    527. 
    528. 				// Live edit
    529. 				if (!$array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad')
    530. 					&& Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'
    531. 						.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')))

    HookCore::exec - [line 1018 - classes/controller/FrontController.php] - [1 Arguments]

    1013. 	 * Initializes page footer variables
    1014. 	 */
    1015. 	public function initFooter()
    1016. 	{
    1017. 		$this->context->smarty->assign(array(
    1018. 			'HOOK_FOOTER'            => Hook::exec('displayFooter'),
    1019. 			'conditions'             => Configuration::get('PS_CONDITIONS'),
    1020. 			'id_cgv'                 => Configuration::get('PS_CONDITIONS_CMS_ID'),
    1021. 			'PS_SHOP_NAME'           => Configuration::get('PS_SHOP_NAME'),
    1022. 			'PS_ALLOW_MOBILE_DEVICE' => isset($_SERVER['HTTP_USER_AGENT']) && (bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE') && @filemtime(_PS_THEME_MOBILE_DIR_)
    1023. 		));

    FrontControllerCore->initFooter - [line 185 - classes/controller/Controller.php]

    180. 				$this->initContent();
    181. 			else
    182. 				$this->errors[] = Tools::displayError('Access denied.');
    183. 
    184. 			if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className)))
    185. 				$this->initFooter();
    186. 
    187. 			// Default behavior for ajax process is to use $_POST[action] or $_GET[action]
    188. 			// then using displayAjax[action]
    189. 			if ($this->ajax)
    190. 			{

    ControllerCore->run - [line 373 - classes/Dispatcher.php]

    368. 			// Execute hook dispatcher
    369. 			if (isset($params_hook_action_dispatcher))
    370. 				Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
    371. 
    372. 			// Running controller
    373. 			$controller->run();
    374. 		}
    375. 		catch (PrestaShopException $e)
    376. 		{
    377. 			$e->displayMessage();
    378. 		}

    DispatcherCore->dispatch - [line 28 - index.php]

    23. *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
    24. *  International Registered Trademark & Property of PrestaShop SA
    25. */
    26. 
    27. require(dirname(__FILE__).'/config/config.inc.php');
    28. Dispatcher::getInstance()->dispatch();

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...