0
function details_klanten($idKlant,$start,$eind){
$this->db->select(' Project.idProject,
Project.Titel,
Project.idProjecttype,
Project.Begindatum,
Project.Deadline,
Project.idKlant,
Projecttypes.idProjecttypes,
Projecttypes.Type,
Werknemer.idWerknemer,
Werknemer.Voornaam,
Statusproject.idStatusProject,
Statusproject.Soort,
Klant.Naam');
$this->db->order_by('Titel', 'asc');
$this->db->from('Project');
$this->db->join('Klant', 'Klant.idKlant = Project.idKlant');
$this->db->join('Projecttypes', 'Projecttypes.idProjecttypes = Project.idProjecttype');
$this->db->join('Werknemer', 'Werknemer.idWerknemer = Project.idWerknemer');
$this->db->join('Statusproject', 'Statusproject.idStatusProject = Project.idStatusProject');
if ($idKlant > 0){
$this->db->where('Klant.idKlant',$idKlant);
$this->db->where('Project.Begindatum >',$start);
$this->db->where('Project.Deadline <',$eind);
}
$query = $this->db->get();
if($query->num_rows()>0){
return $query->result();
}
else{
return false;
}
}
的project.Begindatum
和Project.Deadline
是varchar(10)
。所以它看起來前兩個數字不是完整的日期。例如:將varchar轉換迄今在where子句
$start = '01-04-2014';
'Project.Begindatum' = (Varchar)'02-03-2014'.
然後,它會顯示,因爲 它不僅外觀到'01'(-04-2014) and the '02'(-03-2014)
這和我以前一樣,它仍然沒有看到只有前兩個數字的完整日期。 (當天) – Rene
@Rene閱讀我更新的回答 –
它仍然只看到一天,而不是全日期。 – Rene