2014-10-05 24 views
0

由於某種原因,我看到一個Kohana exeption Exception [ 0 ]: The "users" table doesn't exist. Make sure to import the tables.sql file
我需要做什麼?KOHANA:ORM + MySQL找不到表

19 { 
20 ORM::factory('user'); 
21 } 
22 catch(exception $e) 
23 { 
24 throw new Exception('The "users" table doesn\'t exist. Make sure to import the tables.sql file'); 
25 } 
26 
27 Route::set('Kohanauserauth', user::path().'(/<action>(/<id>))') 
28 -> defaults(array(
29  'controller' => 'Kohanauserauth' 
+0

在第24行上面加上'echo Database_Exception :: text($ e);',那應該會給你特定的錯誤。 – Styphon 2014-10-06 14:48:28

回答

0

我想你已經啓用了「Auth」模塊並且沒有事先設置數據庫表。 Auth需要一個名爲「用戶」的表。表格的模式包含在模塊文件夾中。如果您不使用驗證模塊,請在啓動文件中將其禁用。

你不是說你用的是什麼版本的Kohana的,所以我會假設3.3,所以我會建議讀這第一:http://kohanaframework.org/3.3/guide/auth/

如果你是初次使用Kohana並不願意投入時間在閱讀有限的文檔時,我會建議使用不同的框架,因爲Kohana需要相當長的時間來學習。

+0

沒有。它只是不能連接到數據庫 – 2014-10-05 23:44:05

+0

然後你沒有提供任何地方接近你的問題的足夠的信息。 – SigmaSteve 2014-10-05 23:48:19

+0

請說出我需要提供的信息 – 2014-10-06 14:40:38