2011-08-17 110 views
0

我有下面的代碼,我試圖理解並找到這個錯誤的解決方案。調用成員函數

A PHP Error was encountered 

Severity: Notice 

Message: Undefined property: Tank_auth::$users 

Filename: libraries/Tank_auth.php 

Line Number: 188 

Fatal error: Call to a member function UpdateProfileInfo() on a non-object in /home/xtremer/public_html/kowmanager/application/libraries/Tank_auth.php on line 188 

坦克驗證控制器:http://pastebin.com/iRj11hgR 坦克驗證型號:http://pastebin.com/qhNK5Whz 坦克驗證庫:http://pastebin.com/RVxdzhUa

編輯:多虧了馬克,他能找到這個問題,但我有一個新的問題很奇怪。

A PHP Error was encountered 

Severity: Notice 

Message: Undefined index: userID 

Filename: libraries/Tank_auth.php 

Line Number: 188 
A PHP Error was encountered 

Severity: Warning 

Message: Cannot modify header information - headers already sent by (output started at /home/xtremer/public_html/system/core/Exceptions.php:170) 

Filename: libraries/Session.php 

Line Number: 671 
A PHP Error was encountered 

Severity: Warning 

Message: Cannot modify header information - headers already sent by (output started at /home/xtremer/public_html/system/core/Exceptions.php:170) 

Filename: helpers/url_helper.php 

Line Number: 543 
+1

它看起來不像'application/libraries/Tank_auth.php'有188行? – ChrisA

+1

您粘貼的任何代碼示例中沒有任何$用戶,並且沒有任何代碼示例中有第188行。您對我們持懷疑態度...... –

+0

我只是試圖給出相關代碼,無論如何也無法幫助任何人。 –

回答

1

可能相關:

行187:$this->ci->users
行188:$this->users->UpdateProfileInfo(...);

坦克驗證庫忘了->ci

+0

那麼解決了一件事。有趣的是,我得到一個問題修復,另一個問題被發現。我的新錯誤是在我的文章。 –

+0

還有什麼想法萌芽? –

+1

PHP數組鍵區分大小寫。也許它是'user_id'或'userid',而不是'userID?'很難說。修正未定義的索引警告後,標題錯誤/警告應該消失。 –

1

看起來您的tank_auth/users.php模型沒有加載,或者某處存在命名衝突。你的$ autoload數組是什麼樣的?

+0

$ autoload ['libraries'] = array('database','template','asset','session'); –