Another tip: if you want to have cleaner PHP code, you can create a VIEW in the database, e.g.
For example:
CREATE VIEW view_news AS
SELECT
news.id news_id,
user.id user_id,
user.name user_name,
[ OTHER FIELDS ]
FROM news, users
WHERE news.user_id = user.id;
In PHP:
$sql = "SELECT * FROM view_news";