24 lines
433 B
PHP
24 lines
433 B
PHP
<?php
|
|
/**
|
|
* Připojení se k databázi
|
|
*
|
|
* @return object - připojení k databázi
|
|
*
|
|
*/
|
|
function connectionDB() {
|
|
$db_host = "127.0.0.1";
|
|
$db_user = "kankys";
|
|
$db_password = "Heslo123";
|
|
$db_name = "skola";
|
|
|
|
$connection = mysqli_connect($db_host, $db_user, $db_password, $db_name);
|
|
|
|
if (mysqli_connect_error()) {
|
|
echo mysqli_connect_error();
|
|
exit();
|
|
}
|
|
|
|
return $connection;
|
|
}
|
|
|
|
?>
|