php - Codeigniter after update 3.1.1 to 3.1.2 error batch_update -
since run codeigniter 3.1.1 no problem several update haven't check slide change position id , error on codeigniter 3.1.2
$data = [ ['sl_id' => 49, 'sl_move' => 1], ['sl_id' => 48, 'sl_move' => 2] ]; // error update_batch line : undefined index: sl_id if( ! $this->db->update_batch($this->table, $data, 'sl_id')) { //false } else { //true }
sql syntax error show below:
error number: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near 'then '49' when `sl_id` = '48' else `sl_id` end, `sl_move` = case when `sl' @ line 2 update `tbl_slide` set `sl_id` = case when `sl_id` = '49' when `sl_id` = '48' else `sl_id` end, `sl_move` = case when `sl_id` = '1' when `sl_id` = '2' else `sl_move` end `sl_id` in(,) filename: c:/wamp/www/codeigniter_project/system/database/db_driver.php line number: 691
Comments
Post a Comment