$res = sql_query("SELECT SQL_CALC_FOUND_ROWS a.news_id, a.news_title, a.news_keywords, DATE_FORMAT(a.news_date, '%d.%m.%Y'), a.news_start_text, IF (LENGTH(a.news_end_text)>2,1,0), a.news_comments_counter, a.news_hit_counter, a.news_topic_id, a.news_author_id, a.news_allow_comments, a.news_auto_br, b.news_topics_title, b.news_topics_image, b.news_topics_description, c.admins_login FROM ".news a,news_topics b, admins c WHERE a.news_enabled=1 AND a.news_show_in_home=1 AND a.news_topic_id = b.news_topics_id and a.news_date < NOW() and a.news_author_id=c.admins_id ORDER BY a.news_priority, a.news_date DESC limit ".$offset.", ".$on_page."", $dbi); |