sorry first for my bad English - I'm from Germany.
For Training, I learn to connect a database with PHP.
I have a database with 4 Columns (ID, name, email, passwort) and want to print out all names in the database. When I execute the Script with XAMPP in Chrome, the page is empty.
Can somebody help me?
My PHP-Script - I changed the access-informations
<?php
$link = new mysqli('localhost', 'root', 'password', 'verschlüsselung');
if (mysqli_connect_errno())
{
printf("Verbindung fehlgeschlagen: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT name FROM zugänge";
if ($result = $link->query($query))
{
while ($row = $result->fetch_row())
{
echo $row['name']."<br>";
}
$result->close();
}
?>