title: INSERT query returning false boolean
body: <p>Apologies for the newbie question, I have been struggling to get my insert to work.</p>
  
  <p>A var_dump of $qry returns the correct values, but a var_dump of $insert returns a false boolean. Therefore I am not getting any values inserted into my table and can not understand why.</p>
  
  <p>Would really appreciate a pointer here. Thanks in advance.</p>
  
  <pre><code>&lt;?php
  
  $host = 'localhost';
  $user = 'tim_williams';
  $pass = 'baroness';
  $db  = 'php_db05';
  
  $link = mysqli_connect($host, $user, $pass, $db);
  
  if(!$link) {
    die("Database connection failed");
  }
  
  
  function clean_form($data) {
    global $link;
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    $data = mysqli_real_escape_string($link, $data);
    return $data;
  }
  
  
  if(isset($_POST['submit'])) {
    $fname     = clean_form($_POST['fname']);
    $lname     = clean_form($_POST['lname']);
    $email     = clean_form($_POST['email']);
    $password1 = clean_form($_POST['password1']);
    $password2 = clean_form($_POST['password2']);
    $username  = strtolower($fname.substr($lname,0,1));
    $dateTime   = date('Y-m-d g:i:s',time());
    if ($fname &amp;&amp; $lname &amp;&amp; $email &amp;&amp; $password1 &amp;&amp; $password2 &amp;&amp; $username &amp;&amp;     $dateTime) {
      $qry  =  "INSERT INTO registeredusers ('UserID', 'UserName',  'FirstName', 'Surname', 'EmailAddress', 'Password')
                VALUES ('','$username','$fname', '$lname', '$email',  '$password1','$dateTime')";
    $insert = mysqli_query($link, $qry);
    }
  }
  
  var_dump($insert);
  
  
  ?&gt;
  
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;link rel="stylesheet" href="./css/layout.css" media="screen"  type="text/css"&gt;
      &lt;link rel="stylesheet" href="./css/menu.css" media="screen" type="text/css"&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;New User Registration&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div class="holder"&gt;
  
        &lt;div class="header"&gt;&lt;/div&gt;
        &lt;div class="navbar"&gt;
          &lt;nav&gt;
            &lt;ul&gt;
              &lt;li&gt;&lt;a href="/uni/uni_log_reg/mysql-project-users-login.php"&gt;Login&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="/uni/uni_log_reg/mysql-project-users-add.php"&gt;Register&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/nav&gt;
        &lt;/div&gt;
        &lt;div class="content"&gt;
          &lt;div class="pageheading"&gt;
            &lt;h1&gt;New Users&lt;/h1&gt;
          &lt;/div&gt;
          &lt;div class="contentleft"&gt;
            &lt;h2&gt;Welcome to my site&lt;/h2&gt;&lt;br /&gt;
            &lt;h6&gt;Please register an account with us to access main content and more.&lt;/h6&gt;
          &lt;/div&gt;
          &lt;div class="contentright"&gt;
            &lt;form class="registerform" action="" method="post"&gt;
              &lt;input class="styletxtfield" type="text" name="fname" placeholder="First Name" value=""&gt;&lt;input class="styletxtfield forminput" type="text" name="lname" placeholder="Last Name" value=""&gt;&lt;br /&gt;&lt;br /&gt;
              &lt;input class="styletxtfield" type="text" name="email" placeholder="Email address" value=""&gt;&lt;br /&gt;&lt;br /&gt;
              &lt;input class="styletxtfield" type="text" name="password1" placeholder="Password" value=""&gt;&lt;input class="styletxtfield forminput"     type="text" name="password2" placeholder="Confirm Password" value=""&gt;&lt;br /&gt;&lt;br      /&gt;
                  &lt;input type="submit" name="submit" value="submit"&gt;
                &lt;/form&gt;
              &lt;/div&gt;
  
            &lt;/div&gt;
            &lt;div class="footer"&gt;&lt;/div&gt;
  
          &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>