0){ $strRq .= $strWhere." user_id = ".$intAuthor; $strWhere = " AND "; } // Recherche par catégorie if ($intAuthor > 0){ $strRq .= $strWhere." project_category = ".$intCategory; $strWhere = " AND "; } // Recherche par dates if ($intPeriod == 0){ // Par date exacte if ($strDate != ''){ $strRq .= $strWhere." project_creation_date = '".$strDate."'"; } }else{ // Par période de dates if ($strStartDate != '' && $strEndDate != ''){ $strRq .= $strWhere." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'"; }else{ if ($strStartDate != ''){ // A partir de $strRq .= $strWhere." project_creation_date >= '".$strStartDate."'"; }else if ($strEndDate != ''){ // Avant le $strRq .= $strWhere." project_creation_date <= '".$strEndDate."'"; } } } $strRq .= " ORDER BY project_creation_date DESC"; if ($intLimit > 0){ $strRq .= " LIMIT ".$intLimit; } // Lancer la requête et récupérer les résultats return $this->_db->query($strRq)->fetchAll(); } }