I am trying to get the time to show for articles.
I have set up the field in articles table but each time I post a new article the time comes up as 0000-00-00 00:00:00
Here is the code sending the info to the database:
And here is the section on my php page that displays the articles:
Any ideas?
I have set up the field in articles table but each time I post a new article the time comes up as 0000-00-00 00:00:00
Here is the code sending the info to the database:
PHP:
<?php
include '../includes/config.php';
$insert = "INSERT INTO articles (pagetitle, content, date)
VALUES ('".$_POST['pagetitle']."', '".$_POST['content']."', '".$_POST['date']."')";
$add_data = mysql_query($insert);
?>
And here is the section on my php page that displays the articles:
PHP:
<?php
$sql = "select * from articles";
$result = mysql_query ($sql);
while ($row = mysql_fetch_array($result))
{
$field1= $row["pagetitle"];
$field2= $row["content"];
$field3= $row["date"];
echo "$field1<br>";
echo "$field3<br>";
echo "$field2<br>";
}
?>
Any ideas?