|
codeigniter4 使用update()更新数据库时,出现错误,折腾了好久。
我的代码: $model = new DepCategoryModel(); $where = array('dep_category_id'=>2); $data = array('dep_category_title'=>'888888888888888888'); $model->update($data, $where); 最终打印出来的sql语句是这样的: UPDATE `dep_category` SET `dep_category_title` = '999' WHERE `dep_category`.`id` IN ('888888888888888888') 我的数据库表中不存在id这个字段,这是一个BUG还是我操作上的失误? | |
|
已经解决,设置protected $primaryKey = 'users_id';就可以了,官方文档能不能优化下,可读性太差了
| |