php - 未捕获的错误:prestashop 1.6 中未找到类“Db”
问题描述
我试图在 prestashop 1.6 中安装一个模块
当我检查 phpmyadmin 时,我看到一张桌子不在那里。
所以我去 www/modules/ecster/sq/install.php
我得到这个错误。
Fatal error: Uncaught Error: Class 'Db' not found in /modules/ecsterpay/sql/install.php:45 Stack trace: #0 {main} thrown in /modules/ecsterpay/sql/install.php on line 45
这是我的代码:
$sql = array();
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ecsterpay` (
`id_cart` int(10) NOT NULL,
`id_shop` int(10) NOT NULL,
`key_cart` varchar(200) NOT NULL,
`external_id` varchar(20) NOT NULL DEFAULT \'\',
`internal_id` varchar(20) NOT NULL DEFAULT \'\',
`id_order` int(10) NOT NULL,
`accepted` tinyint NOT NULL DEFAULT 0,
`debit` tinyint NOT NULL DEFAULT 0,
`annul` tinyint NOT NULL DEFAULT 0,
`credit` tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (`id_cart`, `id_shop`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
foreach ($sql as $query) {
if (Db::getInstance()->execute($query) == false) {
return false;
}
}
解决方案
在 install.php 中尝试:include_once('../../../config.inc.php');
问候
推荐阅读
- apache - URL 重写 http > https AND domain.tld > www.domain.tld
- javascript - html2Canvas 下载很模糊,我怎样才能让它更清晰
- coldfusion - ColdFusion 通过 Java 做 OWASP esapi
- amazon-web-services - 在 golang 中订阅 SNS 主题和/或 SQS 队列?
- android - Android Studio 的奇怪行为,一些文件看起来与实际不同
- c# - Xamarin 自定义表视图标题
- python - ElementTree 解析 xml 文件 - 解析问题
- excel - Excel VBA:无法从 VBA 中的日期变量填写
- docker - 如何从 docker 容器在主机中运行 bash 脚本并获得结果
- python - 使用python将列值与数据框中的int进行比较