Beste allemaal,
ik heb een pdo functie gemaakt en dat werkt allemaal.
Nu lukt het me alleen niet om hem te escape kan iemand mijn hier bij helpen?
<?php
public function insertData($table = null, array $data) {
if ($table === null || empty($data)) {
return false;
}
$fields = implode(',', array_keys($data));
$values = implode(',', array_map(array($this, 'quoteValue'), array_values($data)));
$query = 'INSERT INTO ' . $table . '(' . $fields . ')' . ' VALUES (' . $values . ')';
$stmt = $this->_conn->prepare($query);
$stmt->execute($data);
// print_r($stmt->errorInfo());
// print_r($query."<br/>");
$this->insertID = $this->_conn->lastInsertId();
return $this->insertID;
}
?>
1.563 views