TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

displaying date

Page: 1 Reply
Feb 22nd 2003#92026 Report
Member since: Jul 9th 2002
Posts: 85
hey

Im very new to php, and need some help. Im creating a script that will allow users to sign up for various training classes online. First users select which class they want. Depending on their selection, they recieve a list of available class dates in a drop down menu. The problem is that I have the dates stored in the database like: "022103 (mmddyy)". So when the script outputs the date, it shows up in a difficult to read format.

What Im looking for is a script that will change the "022103" into "February 21, 2003". Id like to keep the database date in the simple numbers format it is in, but diplay an easier to read for the users.

I would greatly appreciate any help or suggestions concerning how I could accomplish this.

Thanks!

Here is the current code for the select_date.php:

[PHP]

$class_id = $_POST['class_id'];
session_register('class_id');
$_SESSION['class_id'] = $class_id;

@ $db = mysql_pconnect("host", "user1", "user1");

if (!$db)
{
echo "Could not connect to database.";
exit;
}

mysql_select_db("training_signup");
$query = "select * from ".$class_id."_dates";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
?>

Select Date:


[/PHP]

Thanks again
Reply with Quote Reply
Feb 22nd 2003#92080 Report
Member since: Mar 24th 2002
Posts: 3114
www.php.net/date <-- You can format the date how you want.
Or am I missing the point again?
Reply with Quote Reply
Feb 22nd 2003#92087 Report
Member since: Jul 9th 2002
Posts: 85
Yup, that will do it

Thanks!
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum