Hi
Im new to PHP and MySQL and Im having problems displaying the date how I would like after recalling it from my database. I have searched and looked at some of the posts but I cant get them to work properly and any help would be greatly appreciated.
The current date format is 2005-10-24 and I would like it to be displayed as Monday 24th of October 2005 to fit in with the date format in just pure PHP parts of the site.
<?php
$result = @mysql_query('SELECT newstitle, newsdate, newstext FROM news ORDER BY newsdate');
if (!$result) {
exit('<p>Error performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($result)) {
echo '<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#F0F0F0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#F0F0F0"><span class="style3">' . $row['newstitle'] . '</span></td>
<td bgcolor="#F0F0F0"><div align="right" class="style3">' . $row['newsdate'] . '</div></td>
</tr>
</table></td>
</tr>
<tr>
<td class="style4">' . $row['newstext'] . '</td>
</tr>
</table>
<p>
</p>';
}
?>
The HTML there probably is rather messy but I just wanted to get the site up and running and will work through the code at a later date.
Thanks in advance
Mark