Jump to content

Error at line 791 in file classes/db/Db.php PrestaShopDatabaseException


Recommended Posts

Hello,

Does anyone know how to fix this error? :unsure:
 

Prestashop 1.6.1.2

 

[PrestaShopDatabaseException]

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 'WHERE p.`id_product` = 2p.`id_product` = 20 WHERE p.`id_product` = 20' at line 2
 

UPDATE `alfs_product` p SET p.`quantity` = 100, p.`id_product` = 1 WHERE p.`id_product` = 1p.`id_product` = 2 WHERE p.`id_product` = 2p.`id_product` = 20 WHERE p.`id_product` = 20
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.     }
  • DbCore->displayError - [line 425 - classes/db/Db.php] - [1 Arguments]
    Argument [0]UPDATE `alfs_product` p SET p.`quantity` = 100, p.`id_product` = 1 WHERE p.`id_product` = 1p.`id_product` = 2 WHERE p.`id_product` = 2p.`id_product` = 20 WHERE p.`id_product` = 20
  • DbCore->query - [line 601 - classes/db/Db.php] - [1 Arguments]
    Argument [0]UPDATE `alfs_product` p SET p.`quantity` = 100, p.`id_product` = 1 WHERE p.`id_product` = 1p.`id_product` = 2 WHERE p.`id_product` = 2p.`id_product` = 20 WHERE p.`id_product` = 20
  • DbCore->execute - [line 200 - modules/bkupdate/bkupdate.php] - [1 Arguments]
    195. 												$sql_sp = 'SELECT * FROM `'._DB_PREFIX_.'specific_price` sp WHERE sp.`id_product` = "'.$row['id_product'].'" ';			196. 												$sql_percent .= $row['id_product'];197. 												Db::getInstance()->Execute($sql_percent);198. 											}199. 										}200. 									Db::getInstance()->Execute($sql_up);201. 									if($ps_version >= 150) Db::getInstance()->Execute($sql_up_shop);	202. 									$this->_html .= '<font color="#00ff00">'. $this->l('Update')."</font></td><td>".$arr[0]."</td><td>".$arr[1]."</td><td>".$arr[2]."</td><td>".$arr[3]."</td><td>".$arr[4]."</td></tr>";203. 								}204. 							}else{205. 								$sql = 'SELECT pa.`id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` pa WHERE pa.`reference` = "'.$arr[0].'" ';
  • BkUpdate->getContent - [line 867 - controllers/admin/AdminModulesController.php]
    862. 863.                             if (count($this->errors)) {864.                                 continue;865.                             }866.                             // Get the return value of current method867.                             $echo = $module->{$method}();868. 869.                             // After a successful install of a single module that has a configuration method, to the configuration page870.                             if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent')) {871.                                 Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12');872.                             }
  • AdminModulesControllerCore->postProcessCallback - [line 1116 - controllers/admin/AdminModulesController.php]
    1111.             }1112.         }1113. 1114.         // Call appropriate module callback1115.         if (!isset($ppm_return)) {1116.             $this->postProcessCallback();1117.         }1118. 1119.         if ($back = Tools::getValue('back')) {1120.             Tools::redirectAdmin($back);1121.         }
  • AdminModulesControllerCore->postProcess - [line 178 - classes/controller/Controller.php]
    173.             if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {174.                 $this->setMedia();175.             }176. 177.             // postProcess handles ajaxProcess178.             $this->postProcess();179. 180.             if (!empty($this->redirect_after)) {181.                 $this->redirect();182.             }183. 
  • ControllerCore->run - [line 367 - classes/Dispatcher.php]
    362.             if (isset($params_hook_action_dispatcher)) {363.                 Hook::exec('actionDispatcher', $params_hook_action_dispatcher);364.             }365. 366.             // Running controller367.             $controller->run();368.         } catch (PrestaShopException $e) {369.             $e->displayMessage();370.         }371.     }372. 
  • DispatcherCore->dispatch - [line 58 - admin/index.php]
    53. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {54.     $_REQUEST['controller'] = strtolower($_REQUEST['tab']);55. }56. 57. // Prepare and trigger admin dispatcher58. Dispatcher::getInstance()->dispatch();

Help !!!! :blush::blink::( :( :( :(

Edited by Moris83 (see edit history)
Link to comment
Share on other sites

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