Yes, I tried you code, just substituted the alias for something I liked better. My code looks like this:
Code:
<?php
//-- Declare connection to the database
$db=mysql_connect ("localhost", "butler21_rbutler", "password") or die ('I cannot connect to the database because: ' . mysql_error());
//-- Select Database
mysql_select_db ("butler21_news");
//-- Declare variable to pull data from table
$query="SELECT DATE_FORMAT(Date, '%d-%m-%Y') AS 'NewDate', `Title`, `Content`
FROM `CurrentNews`
ORDER BY `Date`";
//-- Run the query on the DB
$result = mysql_query($query);
//-- Loop through the result array and display results
while($row = mysql_fetch_array($result))
{
$date=$row['Date'];
$title=$row['Title'];
$content=$row['Content'];
//-- Display the results of the array
echo "<p>", $NewDate, "</p>", "\n" ,"<p>", $title, "</p>", "\n", "<p>", $content, "</p>";
}
?>
I'm now accessing the NewDate in the echo'ing of rows.
Bookmarks