CodeIgniter报错: You must use the "set" method to update an entry
set 报错 to The quot an use update
2023-09-27 14:24:02 时间
I'm using codeigniter/datamapper to develop an inviocing application and I'm getting an error that i don't understand. If I do the following:
$i = new Invoice();
$i->save();
Then i get the following error: A Database Error Occurred
You must use the "set" method to update an entry.
Filename: /Users/jim/Sites/example.com/libraries/Datamapper.php
Line Number: 1635
However I can run this all day without any problem:
$i = new Invoice();
$i->notes ='x';
$i->save();
Just wondered why it behaves like this? Any help/comments much appreciated. Thanks
解答:
For the datamapper you must assign the value to the object. If the object is empty then it is not going to save. So firstly set the value for the datamapper object.
比如在用rest工具测试的时候,post请求体没有内容,或者没有设置,会导致提示这个信息
相关文章
- AFNetworking 报错JSON text did not start with array or object and option to allow fragments not set…
- Record has Long.MIN_VALUE timestamp (= no timestamp marker). Is the time characteristic set to 'ProcessingTime', or did you forget to call 'DataStream.assignTimestampsAndWatermarks(...)
- 百度LBS云搜索时报错 "filter:area is not filteable field, please set property in the cloud-storage
- 【BZOJ4373】算术天才⑨与等差数列 线段树+set
- 备战CKA每日一题——第7天 | deployment的升级、回滚、滚动更新策略、roll、set image命令解释、initContainer考题
- yocto编译时报错"fatal: the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead"如何处理?
- zabbix报错cannot set resource limit: [13] Permission denied解决方法
- Android dependency has different version.You should manually set the same version via DependencyReso
- 关于字符集报错显示“255”Unknown initial character set index '255' received from server.
- 【快应用】$set数据方法使用案例
- [已解决]报错:have mixed types. Specify dtype option on import or set low_memory=False
- 《AutoFlow:Learning a Better Training Set for Optical Flow》论文笔记
- 【bzoj3991】[SDOI2015]寻宝游戏 树链的并+STL-set
- SpringBoot项目启动报错:No active profile set, falling back to default profiles:default