Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public function GetAllUtilisateurByFiltres($donnees = NULL) {
  2. $where = "WHERE ";
  3. $array = array();
  4. foreach($donnees as $key => $value){
  5. if(!empty($value)){
  6. $value = addslashes($value);
  7. $where .= $key . " = ? AND ";
  8. $array[] = "$value";
  9. }
  10. }
  11. $where = substr($where, 0, -5);
  12. $sql = "SELECT * FROM vls_users " . $where;
  13. $sth = $this->connexion->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
  14. $sth->execute($array);
  15. $tab = $sth->fetchAll(PDO::FETCH_OBJ);
  16. return $tab;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement