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 'AND id_product = 5022 LIMIT 1' at line 4
SELECT position
FROM ps_category_product
WHERE id_category =
AND id_product = 5022 LIMIT 1
at line 646 in file classes/db/Db.php
641. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
642. }
643. elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
644. {
645. if ($sql)
646. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
647. throw new PrestaShopDatabaseException($this->getMsgError());
648. }
649. }
650.
651. /**
335. if ($this->connect())
336. $this->result = $this->_query($sql);
337. }
338.
339. if (_PS_DEBUG_SQL_)
340. $this->displayError($sql);
341. return $this->result;
342. }
343.
344. /**
345. * Execute an INSERT query
Argument [0] SELECT position FROM ps_category_product WHERE id_category = AND id_product = 5022 LIMIT 1
553. if ($use_cache && $this->is_cache_enabled && ($result = Cache::getInstance()->get(Tools::encryptIV($sql))) !== false)
554. {
555. $this->last_cached = true;
556. return $result;
557. }
558. $this->result = $this->query($sql);
559. if (!$this->result)
560. $result = false;
561. else
562. $result = $this->nextRow($this->result);
563. $this->last_cached = false;
Argument [0] SELECT position FROM ps_category_product WHERE id_category = AND id_product = 5022 LIMIT 1
57. $response = Db::getInstance()->getRow('
58. SELECT position
59. FROM '._DB_PREFIX_.'category_product
60. WHERE id_category = ' . $id_category . '
61. AND id_product = ' . $id_product
62. );
63.
64. if ($response['position'] == null){
65. return false;
66. }
67.
Argument [0] SELECT position FROM ps_category_product WHERE id_category = AND id_product = 5022
2897. }
2898. else {
2899. $id_category = $this->context->cookie->last_visited_category;
2900. }
2901.
2902. $productPos = WPAutumnModel::findProductPos($id_category, $id_product);
2903. $productMaxPos = WPAutumnModel::findProductMaxPos($id_category);
2904. if (!is_int($productPos) || !is_int($productMaxPos)) {
2905. return false;
2906. }
2907.
Argument [0] Argument [1] 5022
2979. }
2980. }
2981.
2982. /* WPAC_productNav */
2983. if (Configuration::get('WPAC_enableProductNav') == 1) {
2984. $productNavLinks = $this->_prepProductNav();
2985. if ($productNavLinks) {
2986. $this->smarty->assignGlobal('WPAC_productNavLinks', $productNavLinks);
2987. }
2988. }
2989.
3014. /* ------------------------------------------------------------- */
3015. /* HOOK (displayHeader)
3016. /* ------------------------------------------------------------- */
3017. public function hookDisplayHeader($params)
3018. {
3019. $this->_prepHook($params);
3020. }
3021.
3022. /* ------------------------------------------------------------- */
3023. /* HOOK (displayFooter)
3024. /* ------------------------------------------------------------- */
Argument [0]
505. if ($use_push && isset($moduleInstance->push_filename) && file_exists($moduleInstance->push_filename))
506. Tools::waitUntilFileIsModified($moduleInstance->push_filename, $moduleInstance->push_time_limit);
507.
508. // Call hook method
509. if ($hook_callable)
510. $display = $moduleInstance->{'hook'.$hook_name}($hook_args);
511. elseif ($hook_retro_callable)
512. $display = $moduleInstance->{'hook'.$retro_hook_name}($hook_args);
513. // Live edit
514. if (!$array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad') && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')))
515. {
Argument [0]
451. if (!$this->useMobileTheme())
452. {
453. // These hooks aren't used for the mobile theme.
454. // Needed hooks are called in the tpl files.
455. $this->context->smarty->assign(array(
456. 'HOOK_HEADER' => Hook::exec('displayHeader'),
457. 'HOOK_TOP' => Hook::exec('displayTop'),
458. 'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''),
459. 'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''),
460. ));
461. }
Argument [0] displayHeader
172. * Assign template vars related to page content
173. * @see FrontController::initContent()
174. */
175. public function initContent()
176. {
177. parent::initContent();
178.
179. if (!$this->errors)
180. {
181. if (Pack::isPack((int)$this->product->id) && !Pack::isInStock((int)$this->product->id))
182. $this->product->quantity = 0;
175.
176. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
177. $this->initHeader();
178.
179. if ($this->viewAccess())
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();
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. }
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();