title: inserting date from form to mysql
body: <p>here is my form code</p>
  
  <p>*my database use date format</p>
  
  <p>Im sure my code got no error, but as soon as i click upload button, the date come out only 0000-00-00</p>
  
  <pre><code>&lt;form action="imageupload.php" method="post" enctype="multipart/form-data"&gt;
      &lt;label for="date"&gt;Date&lt;/label&gt;
      &lt;input type="date" size="60" name="date" id="date"/&gt;
  
      &lt;input type="submit" value="Upload File" /&gt;
      &lt;input type="reset" value="Clear" /&gt;
  
      &lt;/form&gt;
  </code></pre>
  
  <p>here is my image upload.php code</p>
  
  <pre><code>    fclose ($handle);
      // Commit image to the database
  
      $date = htmlentities($_POST['date']);
      $query = 'INSERT INTO user_post (date) VALUES ("' . date '")';
  
    if ( !(mysql_query($query,$link)) ) 
     {
        die('&lt;p&gt;Error writing image to database&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;');
     } 
     else 
     {
        header('Refresh: 2 ; url=imageShow.php');
     }
  </code></pre>