2020-11-30

Undefined variable in php mysqli connect

I have a problem with mysqli connection. Undefined variable $host, $user and $password

PHP:

<?php
    require_once "dbconnect.php";
    $polaczenie = mysqli_connect($host, $user, $password)
    or die ('Nie można połączyć się z MySQL.');
    mysqli_select_db($polaczenie, $database)
    or die ('Nie można połączyc się z bazą.');

dbconnect file:

<?php
    $host="localhost"; // Nazwa hosta
    $user="root"; // Nazwa uzytkownika mysql
    $password=""; // Haslo do bazy
    $database="mieszkancy"; // Nazwa bazy
?>


from Recent Questions - Stack Overflow https://ift.tt/2Viv1SZ
https://ift.tt/eA8V8J

No comments:

Post a Comment