User 'motobelfqtmtbpre' has exceeded the 'max_questions' resource (current value: 40000)SELECT nleft, nright, level_depth
FROM ps_category
WHERE id_category = 2 LIMIT 1
at line 604 in file classes/db/Db.php
598. if ($webservice_call && $errno)
599. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. Query was : '.$sql, 97);
600. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
601. {
602. if ($sql)
603. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
604. throw new PrestaShopDatabaseException($this->getMsgError());
605. }
606. }
607.
608. /**
302. if ($sql instanceof DbQuery)
303. $sql = $sql->build();
304.
305. $this->result = $this->_query($sql);
306. if (_PS_DEBUG_SQL_) {
307. $this->displayError($sql);
308. }
309. return $this->result;
310. }
311.
312. /**
Argument [0] SELECT nleft, nright, level_depth FROM ps_category WHERE id_category = 2 LIMIT 1
517. {
518. $this->last_cached = true;
519. return $result;
520. }
521.
522. $this->result = $this->query($sql);
523. if (!$this->result)
524. return false;
525.
526. $this->last_cached = false;
527. $result = $this->nextRow($this->result);
Argument [0] SELECT nleft, nright, level_depth FROM ps_category WHERE id_category = 2 LIMIT 1
1232. public static function getInterval($id)
1233. {
1234. $sql = 'SELECT nleft, nright, level_depth
1235. FROM '._DB_PREFIX_.'category
1236. WHERE id_category = '.(int)$id;
1237. if (!$result = Db::getInstance()->getRow($sql))
1238. return false;
1239. return $result;
1240. }
1241.
1242. /**
Argument [0] SELECT nleft, nright, level_depth FROM ps_category WHERE id_category = 2
1249. public function inShop(Shop $shop = null)
1250. {
1251. if (!$shop)
1252. $shop = Context::getContext()->shop;
1253.
1254. if (!$interval = Category::getInterval($shop->getCategory()))
1255. return false;
1256. return ($this->nleft >= $interval['nleft'] && $this->nright <= $interval['nright']);
1257. }
1258.
1259. public function getChildrenWs()
Argument [0] 2
73. if (!$id_category || !Validate::isUnsignedId($id_category))
74. $this->errors[] = Tools::displayError('Missing category ID');
75.
76. // Instantiate category
77. $this->category = new Category($id_category, $this->context->language->id);
78. if (!Validate::isLoadedObject($this->category) || !$this->category->inShop())
79. {
80. $this->errors[] = Tools::displayError('Category does not exist');
81. header('HTTP/1.1 404 Not Found');
82. header('Status: 404 Not Found');
83. }
144. /**
145. * Start controller process (this method shouldn't be overriden !)
146. */
147. public function run()
148. {
149. $this->init();
150. if ($this->checkAccess())
151. {
152. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
153. $this->setMedia();
154.
390. {
391. $mycontroller = Controller::getController($controller_class);
392. if( $_SERVER['REMOTE_ADDR']== IP_DEBUG_BLAISE) {
393. // mail('blaise2@motobel.fr', $time_start . ' ' . __FILE__ . ' ' . __LINE__, $_SERVER['REQUEST_URI'] . print_r($this, true));
394. }
395. $mycontroller->run();
396. if( $_SERVER['REMOTE_ADDR']== IP_DEBUG_BLAISE) {
397. // mail('blaise2@motobel.fr', $time_start . ' ' . __FILE__ . ' ' . __LINE__, $_SERVER['REQUEST_URI'] . print_r($this, true));
398. }
399. }
400. catch (PrestaShopException $e)
75.
76. if( $_SERVER['REMOTE_ADDR']== IP_DEBUG_BLAISE) {
77. //mail('blaise2@motobel.fr', $time_start . ' ' . __FILE__ . ' ' . __LINE__, $_SERVER['REQUEST_URI']);
78. }
79.
80. Dispatcher::getInstance()->dispatch();
81.
82. $time_end = microtime(true);
83. $delay = $time_end - $time_start;
84. if($delay > 1) {
85. // error_log(__FILE__ . ' ' . __LINE__ . ' ' . $delay);