When I start my script this Error appears:
Fatal error: Call to a member function bind_param() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/Jil/login_skript.php on line 16
Here is the script:
$sql = "SELECT ID, vorname, nachname, username, email, passwort, profilBild, geschlecht, alter, wohnort, ueberSich FROM benutzer WHERE username LIKE '?' LIMIT 1;";
$stmt = $db->prepare($sql);
$stmt->bind_param("s", $username);
The problem is that ‘alter’ is a MySQL keyword. Enclose all your field names (or at least just ‘alter’) in backticks to fix this.
Also, don’t put quotes around the ‘?’s in a prepared statement. They will be added for you.