title: Adding post values to database using mysqli
body: <p><br>
  I seem to have an issue inserting the post values into my database, and i don't see the error in the coding. I've been looking at it for a while now and to me everything looks right, however when i use the form and submit the data the page reload but no data get inserted into the database.
  <br>
  It would be much appreciated if someone could help me identify the error in the coding.</p>
  
  <p>If you have any questions feel free to ask!</p>
  
  <p>Kind regards Jim</p>
  
  <p><strong>FORM</strong></p>
  
  <pre><code>&lt;?php 
  
   //Show the form if the user is a Admin
  
   if(isset($_SESSION['username'])){
     $username == $_SESSION['username'];
  
     $results = $mysqli-&gt;query("SELECT authority FROM users WHERE username='$username' LIMIT 1");
     while($row = $results-&gt;fetch_object()){
       $aut = $row-&gt;authority;
       }
    } 
    if($aut == 1){
  ?&gt;
  
  &lt;form action="index.php" method="post"&gt;
   &lt;table&gt;
    &lt;tr&gt;
     &lt;td&gt; &amp;nbsp; Title: &lt;/td&gt;
     &lt;td&gt;&lt;input type="text" name="title"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
     &lt;td valign="top"&gt; &amp;nbsp; News: &lt;/td&gt;
     &lt;td&gt;&lt;textarea name="information"&gt;&lt;/textarea&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
     &lt;td&gt; &lt;input type="hidden" value="news"&gt; &lt;/td&gt;
     &lt;td&gt;&lt;input type="submit"&gt;&lt;/td&gt;
    &lt;/tr&gt;
   &lt;/table&gt; &lt;hr&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>MYSQLI</strong></p>
  
  <pre><code>&lt;?php
  }
  
  //Insert into the database
  
  if(isset($_POST['news'])){
   $title = $_POST['title'];
   $information = $_POST['information'];
  
   $mysqli-&gt;query("INSERT INTO  `news` (`title`, `information`) VALUES ( '".$title."', '".$information."')");
  }
  </code></pre>