php - inserting date from form to mysql -


This is my form code

* use my database date format

I'm sure there is no error in my code, but as soon as I click the upload button, the date is only 0000-00-00

  & lt; Form action = "imageupload.php" method = "post" enactepe = "multipart / form-data" & gt; & Lt; Label = "date" & gt; Date & lt; / Label & gt; & Lt; Input type = "date" size = "60" name = "date" id = "date" /> & Lt; Input type = "submit" value = "upload file" /> & Lt; Input type = "reset" value = "clear" /> & Lt; / Form & gt;  

Here's my image upload. Php code

  fclose ($ handle); // Commit the image on database $ date = htmlentities ($ _ POST ['date']); Insert $ Query = 'user_post (date) values ​​(' 'date' ');; if (! (Mysql_query ($ query, $ link)) (die (' (ld; p & gt; image in database) Typing error & lt; / p & gt; & lt; / body & gt; & lt; / html & gt; ');} and {header (' refresh: 2; url = imageShow.php ');}  

You will get your code written on Ymd and $ is missing in $ date Date ']); $ Date = date (' Y-M-D ', Stratom ($ raw dat)); $ Query = "user_post Rik) Include values ​​( '$ date') ";


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -