Data are not saved into database eventhough the code works correctly
<p>Im trying to register a user into a database.The code works correctly but data arent saved into database in the end.The final output is "You are registered successfully!wIT for admin confirmation" as it should be.This is my registration form:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html &gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
print ("&lt;form action='register.php' method='post'&gt;
    &lt;p&gt;Name
        &lt;input type='text' name='firstname'  /&gt;
    &lt;/p&gt;
    &lt;p&gt;Surname
        &lt;input type='text' name='lastname' /&gt;
    &lt;/p&gt;
    &lt;p&gt;Username
        &lt;input type='text' name='username' /&gt;
    &lt;/p&gt;
    &lt;p&gt;Password
        &lt;input type='password' name='password' /&gt;
        &lt;/p&gt;
        &lt;p&gt;Email &lt;input type='text' name='email'/&gt;  &lt;/p&gt;
      Enter your CV: &lt;p&gt; &lt;textarea name='cv' cols='60' rows='50'&gt;&lt;/textarea&gt; &lt;/p&gt;

      
    
  &lt;input type='submit'  value='Register'/&gt;  
&lt;/form&gt;

        ");



if( !($database=mysql_connect("localhost","root",""))||!(mysql_select_db("st_login",$database))  )
   print("Could not connect");

if(isset($_POST['firstname'] )&amp;&amp;isset($_POST['lastname'])&amp;&amp;isset($_POST['username'])&amp;&amp;isset($_POST['password'])
  &amp;&amp;isset($_POST['cv'])/*&amp;&amp;isset($_POST['notat'])&amp;&amp;isset($_POST['lendet'])*/&amp;&amp;isset($_POST['email'])){
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$username=$_POST['username'];
$password=md5($_POST['password']);
$email=$_POST['email'];

$cv=$_POST['cv'];
/*
$notat=$_POST['notat'];
$lendet=$_POST['lendet'];
*/

$query = "INSERT INTO  login (firstname, lastname, username,password,cv,email,admin,approval) VALUES ('$firstname', '$lastname',
 '$username','$password','$cv','$email',0,0)";
}
if ( !empty($firstname)&amp;&amp;!empty($lastname)&amp;&amp;!empty($username) &amp;&amp;!empty($password)&amp;&amp;!empty($cv)&amp;&amp;!empty($email))
{
  if(!($result=mysql_query($query,$database)))
{
    print("Could not execute query");
    die (mysql_error());//ose error
}
echo "YOU HAVE BEEN REGISTERED SUCCESSFULLY!PLEASE WAIT FOR THE ADMIN APPROVAL!";

}
else echo "Fill in all the blank fields";
mysql_close($database);
?&gt;

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

<p>This is my database:<a href="https://i.stack.imgur.com/6kW7X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6kW7X.png" alt="The database"></a></p>