我有以下表格:
discount table:
id
name
description
amount
discount_exception
id
from_date
to_date
discount_id (foreign key to discount table)
折扣例外表用于存储折扣对用户不可用的日期范围,因此不应显示折扣。请注意,discount和discount_exception之间存在1:M的关系。换句话说,一个折扣可以有很多例外。
现在,我编写SQL的方法是获取所有折扣,然后在数组中循环它们,并查询discount_exception表,以确定每个折扣是否在特定的日期范围内
问题
我只是试图恢复到最近的备份,得到了一个非常奇怪的错误。
删除数据库。
删除drupal基文件夹。
在新的Drupal文件夹中复制(从备份)。
Ran install.php
重新安装是成功的(除了未能发送电子邮件),但是在加载站点时,我得到了以下错误:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite2.languages' doesn't exist: SELECT * FROM {languages} ORDER BY weight ASC, name