I've spent all night re-working a guestbook/comment/bulletin board page, and after 2hours of trial an error getting me no where on the date/time I begg of you, please help me,
I'm currently using this table:
`entry_detail` (
`entry_author` varchar(50) NOT NULL default '',
`entry_date` datetime NOT NULL default '0000-00-00 00:00:00',
`entry_comments` text NOT NULL,
) TYPE=MyISAM;
and this short w3schools taught script;
<?php
//entrys
if($_GET['q'] == 0){
$con = mysql_connect("***","***","***");
mysql_select_db("***", $con);;
$result = mysql_query("SELECT * FROM entry_detail");
while($row = mysql_fetch_array($result))
{
echo $row['entry_author'] . " | " . $row['entry_comments'];
echo "<br />";
}
echo"<hr /><br> //+form
<form action='index2.php?q=1' method='post'>
entry_author: <input type='text' name='entry_author' />
entry_comments: <input type='text' name='entry_comments' />
<input type='submit' />
</form>";
}
//process/redirect
if($_GET['q'] == 1){
$con = mysql_connect("***","***","***");
mysql_select_db("***", $con);
$sql="INSERT INTO entry_detail (entry_author, entry_comments, entry_date)
VALUES
('$_POST[entry_author]','$_POST[entry_comments]')";
echo "added <meta http-equiv='Refresh' content='0; url=?'>";
}
?>
All I need left to do is to record the time and display it with each post, so I have the date and also to order the posts by time, but I cant figure out how to insert than get it, if thats even what your sposed to do,
Thank you so very much in advance
{{edit}}
after another hour I've found it, it was simply adding now() into the insert values, but now I have another question, how do I convert 0000-00-00 00:00:00 to something a little more practical for the display like January 1st 2008 12:01am ~ F:NS:Y g:i:a <- (I think)