Hrm, I am having a problem 🙁 I created a SQL table, and made a form to insert the information. Everything works great but the date is not inserting into the DB right. It is showing up as 0000-00-00. I was reading if you have NOW for the value, then it will show up the current date. Can anyone tell me what I can do to my code to fix this problem where it will show the current date.
<html>
<body>
<?php
if ($submit) {
//process form
$db = mysql_connect("localhost", "$user", "$pass");
mysql_select_db("$dbname", $db);
$sql = "INSERT INTO blog (id, title, mood, song, weather, entry, date) VALUES ('$id', '$title', '$mood', '$song', '$weather', '$entry', '$date')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else {
//display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
ID:<input type="text" name="id"><br>
Title:<input type="text" name="title"><br>
Mood:<input type="text" name="mood"><br>
Song:<input type="text" name="song"><br>
Weather:<input type="text" name="weather"><br>
Entry:<textarea name="entry"></textarea><br>
Date:<input type="text" name="date" Value="NOW"><br>
<input type="Submit" name="submit" value="Submit Entry">
</form>
<?php
} //end if
?>
</body>
</html>