mirror of
https://github.com/FlyInTheBox/31TSAI.git
synced 2024-11-09 12:34:11 +01:00
l
This commit is contained in:
parent
76a56cf775
commit
273dd8428d
1 changed files with 29 additions and 0 deletions
29
Zadanie 19.04.2023/index.php
Normal file
29
Zadanie 19.04.2023/index.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Połączenie z bazą</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
$database = 'wylazowski';
|
||||||
|
$servername = 'localhost';
|
||||||
|
$mysqliProceduralConection = mysqli_connect($servername, 'Wylazowski', 'tajnehaslo', $database);
|
||||||
|
|
||||||
|
if (!$mysqliProceduralConection)
|
||||||
|
{
|
||||||
|
die("Próba połączenia z bazą danych zakończyła się niepowodzeniem. Błąd: "
|
||||||
|
. mysqli_connect_error());
|
||||||
|
}
|
||||||
|
echo '<p>Połączono z bazą danych <b>' . $database . '</b> na serwerze <b>' . $servername . '</b><br>';
|
||||||
|
echo 'Host info: ' . $mysqliProceduralConection->host_info . '<br>';
|
||||||
|
echo 'MySQLi stat: ' . mysqli_stat($mysqliProceduralConection) . '</p>';
|
||||||
|
|
||||||
|
|
||||||
|
mysqli_close($mysqliProceduralConection);
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue