即時嘗試將sqlite設置爲輔助適配器並且遇到問題。Zend Db SQLITE設置
我收到以下消息:
Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'reports.reports' doesn't exist
我對錶的代碼是:
class Table_Reports extends Zend_Db_Table_Abstract {
protected $_name = 'reports';
protected $_id = 'report_id';
protected $_rowClass = 'Model_Report';
protected $_adapter = 'dbReports';
protected $_schema = 'reports';
}
如果我改變$ _schema空白,然後它會嘗試使用我的主要mysql數據庫。
我的應用程序配置爲:
resources.multidb.db1.adapter = "PDO_MYSQL"
resources.multidb.db1.host = "localhost"
resources.multidb.db1.dbname = "test"
resources.multidb.db1.username = "root"
resources.multidb.db1.password = ""
resources.multidb.db1.isDefaultTableAdapter = true
resources.multidb.db2.adapter = "PDO_SQLITE"
resources.multidb.db2.dbname = ROOT "/data/reports.db"
任何人都知道怎麼回事?
$reports = new Table_Reports();
$reportRow = $reports->createRow();
請嘗試[打開查詢分析](http://framework.zend.com/manual/en/zend.db.profiler.html),這將使您能夠獲得實際執行的SQL。從那以後,我們可以確定究竟出了什麼問題。我會推測,當它不應該運行時,ALTER TABLE正在運行。 – Charles 2011-03-11 21:04:09