New with PHP and I have an input form in html and the output form is in PHP.
On the input form I type 6-22-2008 for the date and when I hit the sumit button, it wants to store the date in the table as 2008-06-22. then when the table is shown I want to see the date as 06-22-2008.
how do I change the 06-22-2008 to the 2008-06-22 to save in the table and then change it back for viewing and printing?
or
Can I change the table to except the m-d-y format?
I changed the code an I able to enter m-d-y and store it as y-m-d in the table. Now I want to get it from the table and display it as m-d-y. The below code show what I am doing.
Code:
while ($row = mysql_fetch_array($result))
{
// list($year, $month, $day ) = split("-", "CDateCreated");
// $DATE = date('m-d-Y', mktime(0,0,0, $year, $month, $day));
//here I am taking the date out of the table and converting it from
y-m-d to m-d-y and I get from 2008-6-27 to 31-12-1969????
and now do I get it into the diplay below?
echo "<TR>";
echo "<TD>", $row['CName'], "</TD><TD>",
$row['CEmpNo'],"</TD><TD>",
$row['CSubject'],"</TD><TD>",
$row['CMessage'],"</TD><TD>",
$row['CDateCreated'],"</TD><TD>",
$row['CRefNo'],"</TD><TD>","</TD><TD>",
$row['CCompleteDate'],"</TD><TD>",
$row['CDateFollowUp'],"</TD>";
echo "</TR>";
}
mysql_close($connection);
Thanks for any help you can give me,
Richard