[英]CodeIgniter DataMapper Error: You must use the “set” method to update an entry
我正在使用codeigniter / datamapper開發一個inviocing應用程序,我收到一個我不明白的錯誤。 如果我執行以下操作:
$i = new Invoice();
$i->save();
然后我收到以下錯誤:發生數據庫錯誤
You must use the "set" method to update an entry.
Filename: /Users/jim/Sites/example.com/libraries/Datamapper.php
Line Number: 1635
但是我可以整天運行這個沒有任何問題:
$i = new Invoice();
$i->notes ='x';
$i->save();
只是想知道它為什么會這樣? 任何幫助/評論非常感謝。 謝謝
對於datamapper,您必須將值分配給對象。 如果對象為空,則不會保存。 首先設置datamapper對象的值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.