Jump to content

Syntax error when clicking on Online Visitors


Recommended Posts

I'm getting an error when trying to view the current Online Visitors page, both when I try to click on the link from the Dashboard and from the Stats screen.

 

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 ') GROUP BY u.id_customer ORDER BY u.firstname, u.lastname' at line 11

SELECT u.id_customer, u.firstname, u.lastname, pt.name as page
					FROM `ps_connections` c
					LEFT JOIN `ps_connections_page` cp ON c.id_connections = cp.id_connections
					LEFT JOIN `ps_page` p ON p.id_page = cp.id_page
					LEFT JOIN `ps_page_type` pt ON p.id_page_type = pt.id_page_type
					INNER JOIN `ps_guest` g ON c.id_guest = g.id_guest
					INNER JOIN `ps_customer` u ON u.id_customer = g.id_customer
					WHERE cp.`time_end` IS NULL
						 AND c.id_shop IN (1) 
						AND TIME_TO_SEC(TIMEDIFF('2015-03-03 13:07:00', cp.`time_start`)) < 900
					AND c.ip_address NOT IN (1052618596,1838861172,)
					GROUP BY u.id_customer
					ORDER BY u.firstname, u.lastname

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

at line 639 in file classes/db/Db.php
634. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
635. 		}
636. 		elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
637. 		{
638. 			if ($sql)
639. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
640. 			throw new PrestaShopDatabaseException($this->getMsgError());
641. 		}
642. 	}
643. 
644. 	/**
DbCore->displayError - [line 333 - classes/db/Db.php] - [1 Arguments]
DbCore->query - [line 509 - classes/db/Db.php] - [1 Arguments]
DbCore->executeS - [line 92 - modules/statslive/statslive.php] - [1 Arguments]
StatsLive->getCustomersOnline - [line 142 - modules/statslive/statslive.php]
StatsLive->hookAdminStatsModules - [line 512 - classes/Hook.php] - [1 Arguments]
HookCore::exec - [line 211 - controllers/admin/AdminStatsTabController.php] - [3 Arguments]
AdminStatsTabControllerCore->displayStats - [line 56 - controllers/admin/AdminStatsTabController.php]
AdminStatsTabControllerCore->initContent - [line 180 - classes/controller/Controller.php]
ControllerCore->run - [line 374 - classes/Dispatcher.php]
DispatcherCore->dispatch - [line 54 - admin/index.php]

Any help is appreciated - TIA

Link to comment
Share on other sites

  • 9 months later...

the original issue is that the maintenance IP ended with a comma

                    AND c.ip_address NOT IN (1052618596,1838861172,)

So if you have the same exact issue, then go to the maintenance page in your back office and remove any trailing commas

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...

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...