Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT c.id_comment, c.id_parent, u.login, n.title_news, cat.category_name,
- c.`comment`, c.date_time, c.is_active FROM comments c
- LEFT JOIN users u ON u.id = c.id_user
- LEFT JOIN news n ON n.id_news = c.id_news
- LEFT JOIN category cat ON cat.id_category = n.id_category
- ORDER BY c.date_time DESC LIMIT {$start},{$limit};
- SELECT колонки
- FROM таблицы
- JOIN таблица
- WHERE условия
- GROUP BY колонки
- HAVING условие
- ORDER BY колонки
- SELECT c.id_comment,
- c.id_parent,
- u.login,
- n.title_news,
- cat.category_name,
- c.`comment`,
- c.date_time,
- c.is_active
- FROM comments c
- LEFT JOIN users u ON u.id = c.id_user
- LEFT JOIN news n ON n.id_news = c.id_news
- LEFT JOIN category cat ON cat.id_category = n.id_category
- WHERE c.is_active=1
- ORDER BY c.date_time DESC
- LIMIT {$start},{$limit};
Add Comment
Please, Sign In to add comment