我在 codeigniter 中设置它,以便时间戳在数据库中的格式为 (yyyy-mm-dd hh: ii: ss) 到 (yyyy-mm-dd)
function login($patient_ext_id,$birth_dttm) {
$this->db->select('xocp_ehr_patient.patient_ext_id, xocp_persons.person_nm, xocp_persons.birthplace, xocp_persons.birth_dttm, xocp_persons.status_cd, xocp_persons.race_nm');
$this->db->from('xocp_ehr_patient');
$this->db->join('xocp_persons', 'xocp_ehr_patient.person_id = xocp_persons.person_id');
/*$this->db->join("xocp_persons","xocp_persons.person_id = xocp_ehr_patient.patient_ext_id","left");*/
$this->db->where('xocp_ehr_patient.patient_ext_id', $patient_ext_id);
$tgl = $this->db->select(DateTime::createFromFormat('Y-m-d','xocp_persons.birth_dttm'));
$this->db->where($tgl, $birth_dttm);
/*$query = $this->db->get('xocp_persons');*/
$query = $this->db->get('');
return $query->num_rows();
}
文件 database/DB_query_build.php 中的代码无效
public function select($select = '*', $escape = NULL)
{
if (is_string($select))
{
$select = explode(',', $select);
}
// If the escape value was not set, we will base it on the global setting
is_bool($escape) OR $escape = $this->_protect_identifiers;
foreach ($select as $val)
{
$val = trim($val);
if ($val !== '')
{
$this->qb_select[] = $val;
$this->qb_no_escape[] = $escape;
if ($this->qb_caching === TRUE)
{
$this->qb_cache_select[] = $val;
$this->qb_cache_exists[] = 'select';
$this->qb_cache_no_escape[] = $escape;
}
}
}
return $this;
}
严重性:警告消息:为 foreach() 提供的参数无效文件名:database/DB_query_builder.php
行号:294
尚方宝剑之说
一只甜甜圈