1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <?php public function getServeurByName($string) {
$stmt = mysqli_prepare($this->connection, "SELECT DISTINCT * FROM $this->tablename where GSP_nom=?");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt, 's', $string);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
mysqli_stmt_bind_result($stmt,
$row->idServ,
$row->timestamp,
...........
...........
$row->email);
if(mysqli_stmt_fetch($stmt)) {
$row->timestamp = new DateTime($row->timestamp);
return $row;
} else {
return null;
}
} |
Partager