1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public function createUser($item) {
$stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename (nom_user, login, mdp, email) VALUES (?, ?, ?, ?)");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt, 'ssss', $item->nom_user, $item->login, $item->mdp, $item->email);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$autoid = mysqli_stmt_insert_id($stmt);
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
return $autoid;
} |
Partager