2010-04-06 92 views
0

可能重複:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in selectcakephp的烘烤視圖錯誤

我以前烘烤,我已創建的模型的控制器。

當試圖烤使用CakePHP我收到以下錯誤觀點:

Interactive Bake Shell 
--------------------------------------------------------------- 
[D]atabase Configuration 
[M]odel 
[V]iew 
[C]ontroller 
[P]roject 
[Q]uit 
What would you like to Bake? (D/M/V/C/P/Q) 
> v 
--------------------------------------------------------------- 
Bake View 
Path: /Applications/MAMP/htdocs/app/views/ 
--------------------------------------------------------------- 
Possible Controllers based on your current database: 
1. Dealers 
2. Products 
3. Users 
Enter a number from the list above, type in the name of another controller, or 'q' to exit 
[q] > 2 
Would you like to create some scaffolded views (index, add, view, edit) for this controller? 
NOTE: Before doing so, you'll need to create your controller and model classes (including associated models). (y/n) 
[n] > y 
Would you like to create the views for admin routing? (y/n) 
[y] > n 

Warning: mysql_query() expects parameter 2 to be resource, boolean given in /Applications/MAMP/htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 500 

Warning: mysql_errno() expects parameter 1 to be resource, boolean given in /Applications/MAMP/htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 576 

Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 102 

Warning: array_keys() expects parameter 1 to be array, boolean given in /Applications/MAMP/htdocs/cake/console/libs/tasks/view.php on line 263 

Warning: mysql_query() expects parameter 2 to be resource, boolean given in /Applications/MAMP/htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 500 

Warning: mysql_errno() expects parameter 1 to be resource, boolean given in /Applications/MAMP/htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 576 

Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 102 

Warning: array_keys() expects parameter 1 to be array, boolean given in /Applications/MAMP/htdocs/cake/console/libs/tasks/view.php on line 382 

Creating file /Applications/MAMP/htdocs/app/views/products/index.ctp 
Wrote /Applications/MAMP/htdocs/app/views/products/index.ctp 

Creating file /Applications/MAMP/htdocs/app/views/products/view.ctp 
Wrote /Applications/MAMP/htdocs/app/views/products/view.ctp 

Creating file /Applications/MAMP/htdocs/app/views/products/add.ctp 
Wrote /Applications/MAMP/htdocs/app/views/products/add.ctp 

Creating file /Applications/MAMP/htdocs/app/views/products/edit.ctp 
Wrote /Applications/MAMP/htdocs/app/views/products/edit.ctp 
--------------------------------------------------------------- 

View Scaffolding Complete. 

有人知道爲什麼嗎?谷歌並沒有得到很多幫助。

CakePHP的1.2.6下的甲基苯丙胺在OSX 10.6.2

數據庫配置:

class DATABASE_CONFIG { 

    var $default = array(
     'driver' => 'mysql', 
     'persistent' => false, 
     'host' => 'localhost', 
     'login' => 'root', 
     'password' => 'root', 
     'database' => 'cs_db', 
     'prefix' => '', 
     'port' => '/Applications/MAMP/tmp/mysql/mysql.sock', 
    ); 
+0

這非常奇怪,可能貫穿本指南並檢查您的設置。 http://bakery.cakephp.org/articles/view/installing-cakephp-on-macosx雖然這篇文章是爲1.1可能會得心應手:) – 2010-04-07 08:44:28

回答

0

的問題是一種奇怪的。 重新啓動MAMP解決它。我還沒有找到可重複的原因。