kupe
Technical User
- Sep 23, 2002
- 376
PHP brings up news items from a MySQL database. There's a headline, byline, dateline, and the story.
It works well using the following script, which (being new to php) I have adapted. BUT it won't let me format the date from a date field in the database.
$result = @mysql_query('SELECT newsdate FROM jokes WHERE newsid="1"'); if (!$result) { exit('Error performing query: ' . mysql_error() ); }// Display the date in a paragraph while ($row = mysql_fetch_array($result)) {
echo $row['newsdate']; }
It works like this, but won't take a DATE_FORMAT(newsdate, '%b %e'). I have spent an age trying every variation I can think of, without any success. H e l p, please, Experts!
It works well using the following script, which (being new to php) I have adapted. BUT it won't let me format the date from a date field in the database.
$result = @mysql_query('SELECT newsdate FROM jokes WHERE newsid="1"'); if (!$result) { exit('Error performing query: ' . mysql_error() ); }// Display the date in a paragraph while ($row = mysql_fetch_array($result)) {
echo $row['newsdate']; }
It works like this, but won't take a DATE_FORMAT(newsdate, '%b %e'). I have spent an age trying every variation I can think of, without any success. H e l p, please, Experts!