Need help with outputting dates

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 7
Joined: Fri Feb 14, 2003 10:10 pm

Sat Mar 29, 2003 6:21 am

Hi. I'm a complete newbie in that I've never studied PHP in any way shape or form, let alone tried to write code. However I have pages on my site that have been written for me and I need to modify one particular part, so that it displays the date in this manner:

(eg) 21st October, 2003

I have data in tables in MySQL of course, so I'll just give you the functions I've got, and how I've used the date itself:


$sql = "SELECT id, date, name, comments
FROM $table_name

$result = @mysql_query($sql,$connection)
or die("Couldn't execute query.");

while ($k<$num) {

</font> </font>
<table border="0" width="100%" align="center" cellpadding="2" cellspacing="2">
<td valign="top"> <div align="justify"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><?echo "$da-$mo, $yr"; ?></b></font>
<font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><? echo "$comments"; ?></font></div></td>





What do I need to do to change the date to appear in the way I mentioned above?

Any help would be greatly appreciated! Thanks in advance.

New php-forum User
New php-forum User
Posts: 28
Joined: Tue Jan 21, 2003 9:31 pm

Sat Mar 29, 2003 5:00 pm

think you need to go have a good read of

heres the date function of theirs with detailed usage.
[flash width=300 height=100 loop=true][/flash]

Administrator Newbieslair

Post Reply