I am working on a school project, but my code only returns ann HTTP 500 Error while running it. PHP and MySQL are correctly installed and work. I have tested this by using a INSERT command.
My code:
<?php
// Some inputvalues (those are correct)
$user = "";
$pass = "";
$host = "";
$db = "";
$conn = mysqli_connect($host, $user, $pass, $db)
or die("Het is niet gelukt om te verbinden met de database!");
// Vaststellen wat je wil weten
$grab = $_GET['grab'];
$query = "SELECT * FROM informaticaproject WHERE id=1";
$result = mysqli_query($conn, $query)
or die("Geen gegevens opgehaald!");
echo $result;
while ($row = mysqli_fetch_assoc($result)) {
$anwer = $row["'" . $grab . "'"];
}
echo $answer;
mysqli_close($conn);
Can somebody help me please?