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 = 559 LIMIT 1' at line 4
SELECT position
FROM ps_category_product
WHERE id_category =
AND id_product = 559 LIMIT 1
at line 635 in file classes/db/Db.php
629. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
630. }
631. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
632. {
633. if ($sql)
634. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
635. throw new PrestaShopDatabaseException($this->getMsgError());
636. }
637. }
638.
639. /**
319. if ($sql instanceof DbQuery)
320. $sql = $sql->build();
321.
322. $this->result = $this->_query($sql);
323. if (_PS_DEBUG_SQL_)
324. $this->displayError($sql);
325. return $this->result;
326. }
327.
328. /**
329. * Execute an INSERT query
Argument [0] SELECT position FROM ps_category_product WHERE id_category = AND id_product = 559 LIMIT 1
541. if ($use_cache && $this->is_cache_enabled && ($result = Cache::getInstance()->get(Tools::encryptIV($sql))) !== false)
542. {
543. $this->last_cached = true;
544. return $result;
545. }
546. $this->result = $this->query($sql);
547. if (!$this->result)
548. $result = false;
549. else
550. $result = $this->nextRow($this->result);
551. $this->last_cached = false;
Argument [0] SELECT position FROM ps_category_product WHERE id_category = AND id_product = 559 LIMIT 1
56. $response = Db::getInstance()->getRow('
57. SELECT position
58. FROM '._DB_PREFIX_.'category_product
59. WHERE id_category = ' . $id_category . '
60. AND id_product = ' . $id_product
61. );
62.
63. if ($response['position'] == null){
64. return false;
65. }
66.
Argument [0] SELECT position FROM ps_category_product WHERE id_category = AND id_product = 559
2896. }
2897. else {
2898. $id_category = $this->context->cookie->last_visited_category;
2899. }
2900.
2901. $productPos = WPAutumnModel::findProductPos($id_category, $id_product);
2902. $productMaxPos = WPAutumnModel::findProductMaxPos($id_category);
2903. if (!is_int($productPos) || !is_int($productMaxPos)) {
2904. return false;
2905. }
2906.
Argument [0] Argument [1] 559
2978. }
2979. }
2980.
2981. /* WPAC_productNav */
2982. if (Configuration::get('WPAC_enableProductNav') == 1) {
2983. $productNavLinks = $this->_prepProductNav();
2984. if ($productNavLinks) {
2985. $this->smarty->assignGlobal('WPAC_productNavLinks', $productNavLinks);
2986. }
2987. }
2988.
3013. /* ------------------------------------------------------------- */
3014. /* HOOK (displayHeader)
3015. /* ------------------------------------------------------------- */
3016. public function hookDisplayHeader($params)
3017. {
3018. $this->_prepHook($params);
3019. }
3020.
3021. /* ------------------------------------------------------------- */
3022. /* HOOK (displayFooter)
3023. /* ------------------------------------------------------------- */
Argument [0]
501. if ($use_push && isset($moduleInstance->push_filename) && file_exists($moduleInstance->push_filename))
502. Tools::waitUntilFileIsModified($moduleInstance->push_filename, $moduleInstance->push_time_limit);
503.
504. // Call hook method
505. if ($hook_callable)
506. $display = $moduleInstance->{'hook'.$hook_name}($hook_args);
507. elseif ($hook_retro_callable)
508. $display = $moduleInstance->{'hook'.$retro_hook_name}($hook_args);
509. // Live edit
510. 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')))
511. {
Argument [0]
441. if (!$this->useMobileTheme())
442. {
443. // These hooks aren't used for the mobile theme.
444. // Needed hooks are called in the tpl files.
445. $this->context->smarty->assign(array(
446. 'HOOK_HEADER' => Hook::exec('displayHeader'),
447. 'HOOK_TOP' => Hook::exec('displayTop'),
448. 'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''),
449. 'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''),
450. ));
451. }
Argument [0] displayHeader
170. * Assign template vars related to page content
171. * @see FrontController::initContent()
172. */
173. public function initContent()
174. {
175. parent::initContent();
176.
177. if (!$this->errors)
178. {
179. if (Pack::isPack((int)$this->product->id) && !Pack::isInStock((int)$this->product->id))
180. $this->product->quantity = 0;
174.
175. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
176. $this->initHeader();
177.
178. if ($this->viewAccess())
179. $this->initContent();
180. else
181. $this->errors[] = Tools::displayError('Access denied.');
182.
183. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className)))
184. $this->initFooter();
367. // Execute hook dispatcher
368. if (isset($params_hook_action_dispatcher))
369. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
370.
371. // Running controller
372. $controller->run();
373. }
374. catch (PrestaShopException $e)
375. {
376. $e->displayMessage();
377. }
22. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
23. * International Registered Trademark & Property of PrestaShop SA
24. */
25.
26. require(dirname(__FILE__).'/config/config.inc.php');
27. Dispatcher::getInstance()->dispatch();