Data not storing in SQLite database <p>New to PHP. I am trying to create a register and Log In form using PHP and SQLite. Below is my code.</p> <p><strong>register.php</strong></p> <pre><code> &lt;?php class MyDB extends SQLite3 { function __construct() { $this-&gt;open('db/db.db'); } } $db = new MyDB(); if(!$db) { echo $db-&gt;lastErrorMsg(); } else { echo 'Open successfull'; } ?&gt; &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;title&gt;admin portal&lt;/title&gt; &lt;meta charset="UTF-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;link rel="stylesheet" type="text/css" href="css/style.css" media="screen"&gt; &lt;/head&gt; &lt;body&gt; &lt;div align="center"&gt; &lt;div class="form-area"&gt; &lt;form action="" method="post" enctype="multipart/form-data"&gt; &lt;input type="text" name="fname" value="" placeholder="First Name"&gt; &lt;input type="text" name="lname" value="" placeholder="Last Name"&gt; &lt;input type="text" name="username" value="" placeholder="Username"&gt; &lt;input type="email" name="email" value="" placeholder="Email"&gt; &lt;input type="password" name="password" value="" placeholder="Password"&gt; &lt;input type="password" name="cfpassword" value="" placeholder="Confirm Password"&gt; &lt;input type="submit" name="register" value="Register"&gt;&lt;br&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php if (isset($_POST["submit"])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $username = $_POST['username']; $email = $_POST['email']; $password = $_POST['password']; $cfpassword = $_POST['cfpassword']; $sql = &lt;&lt;&lt;EOF INSERT INTO USERS (ID, FNAME, LNAME, USERNAME, EMAIL, PASSWORD, PASSCONFIRM) VALUES (1, '$fname', '$lname', '$username', '$email', '$password', $cfpassword ); EOF; $ret = $db-&gt;exec($sql); if(!$ret){ echo $db-&gt;lastErrorMsg(); } else { echo "Registered Successfully\n"; } $db-&gt;close(); } ?&gt; </code></pre> <p><strong>db.php</strong> </p> <pre><code>&lt;?php class MyDB extends SQLite3 { function __construct() { $this-&gt;open('db/db.db'); } } $db = new MyDB(); if(!$db) { echo $db-&gt;lastErrorMsg(); } else { echo 'Open successfull'; } $sql =&lt;&lt;&lt;EOF CREATE TABLE USERS (ID INT PRIMARY KEY NOT NULL, EMAIL VARCHAR(250) NOT NULL, PASSWORD VARCHAR(250) NOT NULL, FNAME VARCHAR(250) NOT NULL, LNAME VARCHAR(250) NOT NULL, ACCESS VARCHAR(250) NOT NULL, IMAGE VARCHAR(250) NOT NULL, DATE DATETIME NOT NULL, USERNAME VARCHAR(250) NOT NULL, PASSCONFIRM VARCHAR(250) NOT NULL); EOF; $ret = $db-&gt;exec($sql); if(!$ret){ echo $db-&gt;lastErrorMsg(); } else { echo "Table created successfully"; } ?&gt; </code></pre> <p>Please what's wrong with this code. The database opens but registered data is no stored into database. Would also appretiate if i can be linked to a material to read on SQLite3 and HTML forms.</p>