сразу много запросов
Добавлено: 2009-06-07 17:50:26
Код: Выделить всё
SELECT id, username,
( SELECT count(*) from sessions where expires >= '.$time.' or expires is null ),
( SELECT count(*) from comment ),
( SELECT count(*) from content ),
( SELECT count(*) from section ),
( SELECT count(*) from users ),
(select id_co, name_text from comment ORDER BY id desc limit 2 )
(select id_co, name_text from section ORDER BY id desc limit 2 )
(select id_co, name_text from content ORDER BY id desc limit 2 )
(select id_co, name_text from comment ORDER BY id desc limit 2 )
(select id_co, name_text from comment ORDER BY id desc limit 2 )
FROM users ORDER BY id desc limit 1