php送数据找不到表,php – 数据源默认值中找不到的模型表
我正在創建一個cakephp 2.x應用程序.在開發過程中途,我突然發現自己有一個“找不到表”的錯誤.
Missing Database Table
Error: Table blocked for model Parental was not found in datasource default.
Notice: If you want to customize this error message, create project\View\Errors\missing_table
我檢查了我的數據庫,相關的表實際上就在那里.
接下來,我嘗試調試模型.該模型可以訪問該表.關于cakephp無法找到數據表的錯誤仍然存??在.
這是我在調試模型時得到的結果:
\project\Controller\ParentalsController.php (line 5)
object(Parental) {
useTable => 'blocked'
useDbConfig => 'default'
id => null
data => array()
schemaName => null
table => 'blocked'
primaryKey => 'id'
validate => array()
validationErrors => array()
validationDomain => null
name => 'Parental'
alias => 'Parental'
tableToModel => array(
'blocked' => 'Parental'
)
cacheQueries => false
belongsTo => array()
hasOne => array()
hasMany => array()
hasAndBelongsToMany => array()
actsAs => null
Behaviors => object(BehaviorCollection) {
modelName => 'Parental'
defaultPriority => (int) 10
}
whitelist => array()
cacheSources => true
findQueryType => null
recursive => (int) 1
order => null
virtualFields => array()
__backAssociation => array()
__backInnerAssociation => array()
__backOriginalAssociation => array()
__backContainableAssociation => array()
findMethods => array(
'all' => true,
'first' => true,
'count' => true,
'neighbors' => true,
'list' => true,
'threaded' => true
)
}
我還嘗試了以下創建新表而不是模型使用.該模型可以訪問新表,但CakePHP仍然無法檢測到這些新表.
請指教.
總結
以上是生活随笔為你收集整理的php送数据找不到表,php – 数据源默认值中找不到的模型表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 芝士多少钱啊?
- 下一篇: 鬼谷八荒宗门灵石如何获取