【发布时间】:2015-10-12 06:14:49
【问题描述】:
我正在使用 codeigniter,并且有一个 sql 查询。我知道问题出在哪里,但不知道要为它编写正确的查询。 我遇到了这样的错误,
UPDATE `fx_tasks`
SET `timer_status` = 'On', `start_time` = 1444629730, `timer_started_by` = '46'
WHERE `t_id` = '3438'
ORDER BY `timer_status=On` DESC
我的 codeingiter 查询是这样的,
$this->db->set('timer_status', $action);
$this->db->set('start_time', time());
$this->db->set('timer_started_by', $this -> user);
$this->db->order_by("timer_status=On","DESC");
$this->db->where('t_id',$task)->update($this->tasks_table);
codeigniter 中的正确查询是什么?
【问题讨论】:
标签: mysql sql codeigniter sql-update syntax-error