php – 如何在动态查询中创建静态值
发布时间:2020-12-13 16:05:38 所属栏目:PHP教程 来源:网络整理
导读:您好,这是我的代码,我想让它动态,请为我提供一个如何做到这一点的解决方案. $start = strtotime($this-input-post('leave_from'));$end = strtotime($this-input-post('leave_to'));$days_between = ceil(abs($end - $start) / 86400 + 1);if($this-input-po
您好,这是我的代码,我想让它动态,请为我提供一个如何做到这一点的解决方案.
$start = strtotime($this->input->post('leave_from')); $end = strtotime($this->input->post('leave_to')); $days_between = ceil(abs($end - $start) / 86400 + 1); if($this->input->post('leave_type') == 3){ $days_between = 0.5; } 我想让这个动态如何使用查询. $q = "set leave_applications.days = '0.5' on leave_applications where leave_type = 3 "; $days_between = $this->leave_application_model->q_single($q); 不知道它是否正确但是它显示错误
帮帮我怎么做. 解决方法UPDATE `leave_applications` SET `days` = '0.5' WHERE `leave_type` = 3 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |