This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
How can I get the date to store in the database in mm-dd-yyyy format?
Started 16 years ago by bsimpson | 2 posts |
-
I wrote my form up and then wrote a cgi script to display the form almost identically to the machform version (even uses the same css) and it just pulls the data out of the database, however the date comes out of the database like this
"1999-11-30 "
I looked through the view_functions.php and saw it was all set to European date, yet on the form itself, it is
mm dd yyyy, which is what i want. How can I get the date to store in the database in mm-dd-yyyy format?also, is there a way for text boxes to understand line breaks. So if someone types multiple paragraphs (by hitting return), they dont just bleed together? I know you can use html in the text box, but that isn't an option for the end users.
Posted 16 years ago # -
Hi,,
MySQL use standard SQL to store date format to database, which is 'YYYY-MM-DD'. if you only want to retrieve date field with different format, maybe you can consider to use "date_format" function from mySQL and the your SQL will be like this
select date_format(element_2,'%m-%d-%Y') from ap_form_2
for text box line break, why you don't use paragraph text field (text area) instead of text box ?
MachForm Support
Posted 16 years ago #
Reply
You must log in to post.