$dbh = new PDO(
'mysql:dbname=имя_базы_данных;host=адрес_хоста',
'логин',
'пароль',
[PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"]
);
$sth = $dbh->prepare("SELECT `id`, `name` FROM `users` WHERE `id` = :id");
$sth->execute(['id' => $_GET['id'] ?? null);
$result = $sth->fetch(PDO::FETCH_ASSOC);
print_r($result);