Jump to content

Formating Date Output from sql


limecity

Recommended Posts

I made a php form which enable the user to select a date and submit, it will enter the database with this code:

 

 

$_POST['indate'] = date("Y",time())."-".$_POST['ciMM']."-".$_POST['ciDD'];

$_POST['outdate'] = date("Y",time())."-".$_POST['coMM']."-".$_POST['coDD'];

 

 

I also manage to output the date with this coding

 

<?php

        while ($row = mysql_fetch_array($result))

        {

        echo'<tr><td>' '</td><td>'.$row['indate'].'</td><td>'.$row['outdate'].'</td><td> </td></tr>';

          }

?>

 

but the output became this "2007-09-06" format.

 

PROBLEM

How do i output it to be like 2007-September-06 ?

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/50206-formating-date-output-from-sql/
Share on other sites

oh. thanks for the reply.

okay, i might try diff approach.

 

my form is a plain html

with two drop down bar [day] [month] for the user selection

 

as you see here

$_POST['indate'] = date("Y",time())."-".$_POST['ciMM']."-".$_POST['ciDD'];

$_POST['outdate'] = date("Y",time())."-".$_POST['coMM']."-".$_POST['coDD'];

 

ciMM is the variable for Month

ciDD is the varibale for Date

 

------------------

 

as you suggested,

 

how do i insert those data into the database as plain format and pull it out with formating inside the table created on the page?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.