Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Prestashop数据库异常_Php_Mysql_Database_Prestashop - Fatal编程技术网

Php Prestashop数据库异常

Php Prestashop数据库异常,php,mysql,database,prestashop,Php,Mysql,Database,Prestashop,我有一个flash模块,用于计算产品的测量值,一旦计算出来,就会给出要添加到购物车的按钮。请查看此错误: [PrestaShopDatabaseException] 密钥“主”的重复条目“739-6261-21011-0” 在文件class/db/db.php的第765行 DbCore->query-[第578行-classes/db/db.php]-[1个参数] DbCore->execute-[line 3774-classes/Cart.php]-[1个参数] CartCore->setN

我有一个flash模块,用于计算产品的测量值,一旦计算出来,就会给出要添加到购物车的按钮。请查看此错误:

[PrestaShopDatabaseException]

密钥“主”的重复条目“739-6261-21011-0”

在文件class/db/db.php的第765行

DbCore->query-[第578行-classes/db/db.php]-[1个参数]

DbCore->execute-[line 3774-classes/Cart.php]-[1个参数]

CartCore->setNoMultishipping-[line 446-override/controllers/front/orderpccontroller.php]

ControllerCore->run-[第373行-classes/Dispatcher.php]

DispatcherCore->dispatch-[第28行-index.php]


在普雷斯塔肖普的五个步骤中付款,如果有效,但一页签出模块不起作用,出现此错误。

我看到你在普雷斯塔肖普官方论坛上接受了回复,我将在这里发布

key n ps_cart_产品表包含4个元素: -识别车 -id_产品 -id\u地址\u递送 -id\u产品属性

在查询中更新关键元素(id\u地址\u交付) 从您的sql更新中,我看到id_address_delivery等于:21011 此id购物车和产品的条目已存在


但你能解释一下这对你有什么帮助吗?

是普雷斯塔肖普的巫婆版吗?
UPDATE `ps_cart_product`
        SET `id_address_delivery` = (
            SELECT `id_address_delivery` FROM `ps_cart`
            WHERE `id_cart` = 739 AND `id_shop` = 1
        )
        WHERE `id_cart` = 739
760. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
761.        }
762.        elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
763.        {
764.            if ($sql)
765.                throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
766. 
767.            throw new PrestaShopDatabaseException($this->getMsgError());
768.        }
769.    }
770. 
413.            if ($this->connect())
414.                $this->result = $this->_query($sql);
415.        }
416. 
417.        if (_PS_DEBUG_SQL_)
418.            $this->displayError($sql);
419. 
420.        return $this->result;
421.    }
422. 
423.    /**
 573.   public function execute($sql, $use_cache = true)
 574.   {
 575.       if ($sql instanceof DbQuery)
 576.           $sql = $sql->build();
 577. 
 578.       $this->result = $this->query($sql);
 579.       if ($use_cache && $this->is_cache_enabled)
 580.           Cache::getInstance()->deleteQuery($sql);
 581. 
 582.       return (bool)$this->result;
 583.   }
 3769.      '.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '');
 3770. 
 3771.      $cache_id = 'Cart::setNoMultishipping'.(int)$this->id.'-'.(int)$this->id_shop.((isset($this->id_address_delivery) && $this->id_address_delivery) ? '-'.(int)$this->id_address_delivery : '');
 3772.      if (!Cache::isStored($cache_id))
 3773.      {
 3774.          if ($result = (bool)Db::getInstance()->execute($sql))
 3775.              $emptyCache = true;
 3776.          Cache::store($cache_id, $result);
 3777.      }
 3778. 
 3779.      if (Customization::isFeatureActive())
441.                     }
442.                 }
443.             }
444. 
445.             // As the cart is no multishipping, set each delivery address lines with the main delivery address
446.             $this->context->cart->setNoMultishipping();
447. 
448.             $is_old_browser = false;
449.             preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
450.             if (count($matches) < 2) {
451.                 preg_match('/Trident\/\d{1,2}.\d{1,2}; rv:([0-9]*)/', $_SERVER['HTTP_USER_AGENT'], $matches);
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();