You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 5SELECT * FROM ps_cs_blog_comment a
LEFT JOIN ps_cs_blog_comment_lang b
ON (a.id_cs_blog_comment = b.id_cs_blog_comment AND b.id_lang = 1)
WHERE a.id_shop = 1 AND b.id_lang=1 AND (a.active = 1) AND (a.id_cs_blog_post=3)
ORDER BY a.date_add DESC LIMIT 0,
at line 791 in file classes/db/Db.php
786. if ($webservice_call && $errno) {
787. $dbg = debug_backtrace();
788. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
790. if ($sql) {
791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
792. }
793.
794. throw new PrestaShopDatabaseException($this->getMsgError());
795. }
796. }
420. $this->result = $this->_query($sql);
421. }
422. }
423.
424. if (_PS_DEBUG_SQL_) {
425. $this->displayError($sql);
426. }
427.
428. return $this->result;
429. }
430.
Argument [0] SELECT * FROM ps_cs_blog_comment a LEFT JOIN ps_cs_blog_comment_lang b ON (a.id_cs_blog_comment = b.id_cs_blog_comment AND b.id_lang = 1) WHERE a.id_shop = 1 AND b.id_lang=1 AND (a.active = 1) AND (a.id_cs_blog_post=3) ORDER BY a.date_add DESC LIMIT 0,
638. throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
639. }
640. return $this->execute($sql, $use_cache);
641. }
642.
643. $this->result = $this->query($sql);
644.
645. if (!$this->result) {
646. $result = false;
647. } else {
648. if (!$array) {
Argument [0] SELECT * FROM ps_cs_blog_comment a LEFT JOIN ps_cs_blog_comment_lang b ON (a.id_cs_blog_comment = b.id_cs_blog_comment AND b.id_lang = 1) WHERE a.id_shop = 1 AND b.id_lang=1 AND (a.active = 1) AND (a.id_cs_blog_post=3) ORDER BY a.date_add DESC LIMIT 0,
240. $sql = 'SELECT * FROM '._DB_PREFIX_.'cs_blog_comment a
241. LEFT JOIN '._DB_PREFIX_.'cs_blog_comment_lang b
242. ON (a.id_cs_blog_comment = b.id_cs_blog_comment AND b.id_lang = '.$id_lang.')
243. WHERE a.id_shop = '.$id_shop.' AND b.id_lang='.($id_lang ? $id_lang : Configuration::get("PS_LANG_DEFAULT")).' AND '.' (a.active = 1) AND (a.id_cs_blog_post='.$this->id_cs_blog_post.')
244. ORDER BY a.date_add DESC '.($viewall ? '' : 'LIMIT 0, '.$nb.'');
245. return (Db::getInstance()->ExecuteS($sql));
246. }
247.
248. public function getIdAllPost($id_lang=null,$id_shop=null)
249. {
250. $sql = 'SELECT a.id_cs_blog_post FROM '._DB_PREFIX_.'cs_blog_post a
Argument [0] SELECT * FROM ps_cs_blog_comment a LEFT JOIN ps_cs_blog_comment_lang b ON (a.id_cs_blog_comment = b.id_cs_blog_comment AND b.id_lang = 1) WHERE a.id_shop = 1 AND b.id_lang=1 AND (a.active = 1) AND (a.id_cs_blog_post=3) ORDER BY a.date_add DESC LIMIT 0,
148. $viewall = true;
149. $this->context->smarty->assign('viewall', $viewall);
150. }
151. else
152. $viewall = false;
153. $temps = $postObj->getCommentForPost($id_lang,$id_shop,$nb,$viewall);
154. $comments = array();
155. foreach($temps as $comment)
156. {
157. $comment['date_add'] = $postObj->formatDateAdd($comment['date_add']);
158. $comments[] = $comment;
Argument [0] 1 Argument [1] 1 Argument [2] Argument [3]
26. {
27. $this->id_cs_blog_post = Tools::getValue('id_cs_blog_post');
28. $this->csLink = new csLink();
29. $this->csTag = new CSBLTag();
30. parent::initContent();
31. $this->_display();
32. $this->setTemplate('post.tpl');
33. }
34.
35. function _display()
36. {
184. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
185. $this->initHeader();
186. }
187.
188. if ($this->viewAccess()) {
189. $this->initContent();
190. } else {
191. $this->errors[] = Tools::displayError('Access denied.');
192. }
193.
194. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
362. if (isset($params_hook_action_dispatcher)) {
363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
364. }
365.
366. // Running controller
367. $controller->run();
368. } catch (PrestaShopException $e) {
369. $e->displayMessage();
370. }
371. }
372.
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();