Webmaster Forums 101 - Free Help and Discussions
 
 
 

MEMBER REWARDS - Earn free advertising by participating in these forums! Click here for details.

Welcome to Webmaster Forums 101!

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th June 2008, 02:55 AM   #1

Username: rmartin
Rank: WF101 Newbie
Join Date: Jun 2008
Posts: 1
Points: 17.77
Default date conversion input to table?

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

Last edited by rmartin : 1st July 2008 at 01:22 AM.
rmartin is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Login
User Name
Password


Featured Members


Featured Links


Useful Resources
Webmaster Resources
Developers Tools
Developer Tutorials


Partners

All times are GMT +10. The time now is 05:18 AM.


Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.3.2
 
 
WEBMASTER FORUMS 101
ARCHIVE
CONTACT US
TOP
   
© Webmaster Forums 101 2005. All Rights Reserved.
Design by: vBCore