(NOTE: I am fairly new to PHP and most explainations will most likely confuse me alot, such as ones displayed on "helpful" tutorial sites.)
Here is my current code for inputting the date of the submit botton was pushed:
if(isset( $submit ))
$sql = mysql_query("INSERT INTO `blog` (`id`, `date_entered`) VALUES ('', CURDATE( ))");
$query = "SELECT * FROM `blog`";
$data = mysql_query($query);
= mysql_result($data, $i, 'date_entered');
$show_posts = count($posts);
<table align="center" border="0" width="80%">
<div align="right"><? echo $posts[$i]['date_entered']
<?php } ?>
<form method="post" action="login.php">
<input name="date_entered" type="hidden">
<input value="submit" name="submit" type="submit">
Ok, so here's a short history of my issue:
1. Currently, the time will show up as, using today as an example, 2005-08-29.
2. I've had people try to help me already, and suggested I use TIME() instead of CURDATE() and format the date where it's outputted now as DATE('l, F j, Y', $posts[$i]['date_entered']
), but that only gives me: Wednesday, December 31, 1969. It's the same if I just keep using CURDATE().
DID NOT help me. It only confused me more.
4. PHPBuilder.com and PHP.net have also just confused me more.
5. I have tried making date_entered a varchar, date, datetime, int, and timestamp, as well as trying to output the date as unix_timestamp. Those all give the same output.
6. I am running a while loop because this will be used for other scripts I have. Most 'fetch' statements only give me loads of errors.
I have a feeling when I use DATE(), it's only reading the l,F j, Y as 0, therefore resetting the time to 1969. I would like to display the date as, using today as an example: Monday, August 29, 2005 if it is possible. This seemed like a fairly simple issue at first, but