Mysql database doesn't receive form content
Hi! I just started working with PHP and I followed a simple tutorial online to create a form but it isn't working.I have an account on 1&1, i created the database there and the table.When I submit the form it works with no errors but when i check the table online nothing is there.
I double checked my table and my row has the same name so it is ok.
Any help would be greatly appreciated!
My form:
<form action="demo.php" method="post"/>
<p>Input 1: <input type="text" name="input1"/></p>
<input type="submit" value="Submit"/>
</form>
demo.php:
<?php
$host_name = "blablabla";
$database = "blablabla";
$user_name = "blablabla";
$password = "blablabla";
$connect = mysqli_connect($host_name, $user_name, $password, $database);
if(mysqli_connect_errno())
{
echo '<p>Verbindung zum MySQL Server fehlgeschlagen: '.mysqli_connect_error().'</p>';
}
else
{
echo '<p>Verbindung zum MySQL Server erfolgreich aufgebaut.</p>';
}
$value=$_POST['input1'];
$sql = "INSERT INTO demo (input1) VALUES ('$value')";
mysqli_close();
?>
