Skip to content

Commit

Permalink
Merge pull request #37 from lpotherat/patch-2
Browse files Browse the repository at this point in the history
Update connector.php
  • Loading branch information
wakdev committed Mar 29, 2013
2 parents 7798236 + 4294854 commit 4725944
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions core/common/class/db/pdo/connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ public function rowCount(){

/* FETCH */
//MODES : PDO::FETCH_ASSOC | PDO::FETCH_BOTH | PDO::FETCH_BOUND | PDO::FETCH_CLASS | PDO::FETCH_INTO | PDO::FETCH_LAZY | PDO::FETCH_NUM | PDO::FETCH_OBJ
public function fetch($mode = ""){
public function fetch($mode = "BOTH"){
return $this->_db_result->fetch($this->getFetchConstant($mode));
}

/* FETCH ALL */
public function fetchAll($mode = ""){
public function fetchAll($mode = "BOTH"){
$this->execute();
return $this->_db_result->fetchAll();
return $this->_db_result->fetchAll($this->getFetchConstant($mode));
}

/* RESULT CLOSE */
Expand All @@ -188,18 +188,14 @@ private function getFetchConstant($mode){
case "ASSOC":
case "MYSQL_ASSOC":
return PDO::FETCH_ASSOC;
break;
case "NUM":
case "MYSQL_NUM":
return PDO::FETCH_NUM;
break;
case "BOTH":
case "MYSQL_BOTH":
return PDO::FETCH_BOTH;
break;
default:
return PDO::FETCH_BOTH;
}
}
}
?>
?>

0 comments on commit 4725944

Please sign in to comment.