Can't connect to localhost mysql database
<p>I'm trying to make a simple form that can be stored on mysql database. Whenever I try to connect it won't let me. Here's what I have:</p>

<p>PHP:</p>

<pre><code>&lt;?php

define('DB_NAME', 'forms1');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');

$link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD);

if (!$link) {
    die('Could not connect: ' . mysqli_error());
}

$db_selected = mysqli_select_db(DB_NAME, $link);

if (!$db_selected) {
    die('Can\'t use ' . DB_NAME . ': ' . mysqli_error());
}

$value = $_POST['input1'];
$value2 = $_POST['input2'];

$sql = "INSERT INTO demo (input1, input2) VALUES ('$value', '$value2')";

if (!mysqli_query($sql)) {
    die('Error: ' . mysqli_error());
}

mysqli_close();
?&gt;
</code></pre>

<p>HTML:</p>

<pre><code>&lt;form action="demo.php" method="post" /&gt;
&lt;p&gt;Input 1: &lt;input type="text" name="input1" /&gt;&lt;/p&gt;
&lt;p&gt;Input 2: &lt;input type="text" name="input2" /&gt;&lt;/p&gt;
&lt;input type="submit" value="Submit" /&gt;
&lt;/form&gt;
</code></pre>

<p>I the correct credentials, but when I open up my page it says this, "Can't use forms1:" </p>

<p>Doesn't even give me the error.</p>