It needs to connect to a database, but it doesn't. : <pre><code>&lt;?php 
session_start();
$host="localhost";
$username="root";
$password="";
$db_name="registrering";
$tbl_name="users";

$conn = mysqli_connect($host, $username, $password, $db_name);

if(!$conn) {
die("Connection failed: " . mysqli_connect_error());
}

 ?&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;user registration system using php and PHP and Mysq&lt;/title&gt;
    &lt;!---&lt;link rel="stylesheet" type="text/css" href="style.css"&gt;--&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div style="float:right; width:70%"&gt;
&lt;table width="150px" border="0" cellpadding="3" cellspacing="1"&gt;
        &lt;h2&gt;Registrer&lt;h2/&gt;
        &lt;form method="post" action=" "&gt;
        &lt;br&gt;
            &lt;tr&gt;
                &lt;td&gt;Brugernavn&lt;/td&gt;
                &lt;td&gt;:&lt;/td&gt;
                &lt;td&gt;&lt;input type="text" name="Brugernavn"&gt; &lt;/td&gt;
            &lt;/tr&gt;
            &lt;br&gt;
            &lt;tr&gt;
                &lt;td&gt;Email&lt;/td&gt;
                &lt;td&gt;:&lt;/td&gt;
                &lt;td&gt;&lt;input type="text" name="Email"&gt; &lt;/td&gt;
            &lt;/tr&gt;
            &lt;br&gt;
            &lt;tr&gt;
                &lt;td&gt;Password&lt;/td&gt;
                &lt;td&gt;:&lt;/td&gt;
                &lt;td&gt;&lt;input type="password" name="Password"&gt;&lt;/td&gt;
            &lt;/tr&gt;
                &lt;input type="submit" name="registrer" value="Registrer"&gt;

                &lt;p&gt;
                    Allerede medlem? &lt;a href="login.php"&gt;Log ind&lt;/a&gt;
                &lt;/p&gt;
        &lt;/form&gt;
&lt;/div&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php
if (isset($_POST["registrer"]))
{
$my_username=$_POST["Brugernavn"];
$my_email=$_POST["Email"];
$my_password=$_POST["Password"];

$sql = "INSERT INTO 'users'(`username`, `email`, `password`) VALUES ('$my_username','$my_email','$my_password')";
$resultat = mysqli_query($conn, $sql);
}
?&gt;
</code></pre>

<p>It needs to connect to a database, but it doesn't. It's on a localhost and we can't insert data into a database. The database consists of a username, email and password. 
We are using varchar(65) and utf8_general_ci.</p>
