My mistake. I forgot to change the SQL statement to explicitly assign n.id and c.id to a variable. Thank you bogu for pointing that out.
This should work...
SQL = "SELECT n.id as news_id, c.id as cat_id, n.title as news_title,
n.fulltext as news_text, c.title as cat_title FROM news n
LEFT JOIN categories c ON n.categories_id = c.id
ORDER BY n.id DESC";
$result = @mysql_query( $SQL );
while( $row = @mysql_fetch_array( $result ) ) {
echo "<h1>".$row[news_title]."</h1><p>".$row[news_text]."</p><p>News ID: ".$row[news_id]."</p>";
}
?>
The above code will make the following database information available to you:
$row[news_id] // the ID number of the news entry
$row[news_title] // the title of the news entry
$row[news_text] // the full text of the news entry
$row[cat_id] // the ID number of the category
$row[cat_title] // the title of the category
After performing a JOIN, you have to explicity assign the database values you want available to your PHP script, because pulling information from multiple database tables can cause conflicts between values in the tables.
Let me know if that code worked.