Why is n.author='$host[id]'
ignored?
$host[id]=5;
SELECT
n.id,n.name,n.text,
r.title,
COUNT(c.news_id) comments
FROM news n LEFT JOIN rub r
ON
r.news_id=n.id
LEFT JOIN comments c
ON
n.id = c.news_id AND c.status='1' AND n.author='$host[id]'
GROUP BY n.id
ORDER BY n.id DESC LIMIT 10
I need only those rows where 'news'.'author'=$host[id], but executing this query I got all the news from the table. Why does it happen?