php Data not stored in mySQL database using XAMPP
<p>I have this code and I am using the latest version of XAMPP:</p>

<p>filename: store.html</p>

<pre><code>&lt;!DOCTYPE html&gt;

&lt;html&gt;
&lt;body&gt;

&lt;form action="store.php" method="post"&gt;
User input: &lt;input type="text" name="userinput"&gt;&lt;br&gt;
&lt;input type="submit"&gt;
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>filename: store.php</p>

<pre><code>&lt;?php

$servername = "localhost";
$username = "root";
$password = "";
$dbname = "database";


// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn-&gt;connect_error) {
     die("Connection failed: " . $conn-&gt;connect_error);
 } 
 echo "Connected successfully";

$input = $_POST["userinput"];


$sql = "INSERT INTO table_1 (s_num)
VALUES ('$input')";


 ?&gt;
</code></pre>

<p>Whatever I do, no data is added to the database. Please help. Thank you.</p>