使用 CI,我需要使用子查询进行插入忽略。尝试执行此操作时出现代码点火器错误:
$data = array(
"user_id" => $user_id,
"workload_id" => $wid
);
$this->db->set($data);
$this->db->set("order", "(SELECT ifnull(max(`order`)+1, 0) FROM (SELECT * FROM default_workloads_users A ) B WHERE user_id=".$user_id.")", FALSE);
//$this->db->insert("default_workloads_users");
$ins = $this->db->insert_string("default_workloads_users");
$ins = str_replace("INSERT", "INSERT IGNORE", $ins);
$this->db->query($ins);
它告诉我我缺少 insert_string 的第二个参数。想法?