right iv managed to get it to output something...
Date: 2007-05-04 00:00:00
as you can see its outputted the date that it was submitted, but not the time...
iv created a table called entry_date which has a type of "datetime" and the value " 0000-00-00 00:00:00 "
do i need to insert additional code for the time or should it carry it out using the same process.
Date: 2007-05-04 00:00:00
as you can see its outputted the date that it was submitted, but not the time...
iv created a table called entry_date which has a type of "datetime" and the value " 0000-00-00 00:00:00 "
do i need to insert additional code for the time or should it carry it out using the same process.
Code:
[<?php
include "connect.php";
if(isset($_POST['submit']))
{
$entry_date=$_POST['entry_date'];
$name=$_POST['name'];
$comment=$_POST['comment'];
if(strlen($name)<1)
{
print "You did not enter a name.";
}
else if(strlen($comment)<1)
{
print "You did not enter a comment.";
}
else
{
$insert="Insert into visitordata (name,comment,entry_date) values('$name','$comment',current_date)";
mysql_query($insert) or die("Could not insert comment");
print "Comment added. <A href='display.php'>Click here</a> to see all comments.";
}
}
?>