I want to insert some values into a mysql database and thought it can't be that hard. However I was wrong, maybe i am overlooking something simple.
This is my code:
$db = mysqli_connect("localhost", "*****", "*********", "usr_web633_3");
if(!$db)
{
exit("Error: ".mysqli_connect_error());
}
$sql = "INSERT INTO anmeldungen ('ID', 'vorname', 'name', 'gender', 'str', 'hausnummer', 'telefon', 'gemeinde', 'vegetarier'')
VALUES ('id', 'vorname', 'name', 'gender', 'str', 'hausnummer', 'telefon', 'gemeinde', 'vegetarier')";
$sqlinsert = mysqli_query($db, $sql);
if($sqlinsert == true) {
echo "works!";
}
else {
echo "doesn't work:(";
}
It doesn't work like it should.. the values are just placeholders.
Hope you can help!