include('includes/application_top.php'); $sql_categories = "SELECT * FROM tbl_categories WHERE parent_id=0 and status=1 ORDER BY categories_name , sort_order"; $result_categories = mysql_query($sql_categories) or die(DB_QUERY_ERROR); $sql_classified = "SELECT c.*, ct.cat_url_name FROM tbl_classified c, tbl_classified_to_categories cc , tbl_categories ct WHERE cc.classified_id=c.classified_id and ct.categories_id=cc.categories_id and c.status='1' group by c.classified_id ORDER BY c.classified_id desc LIMIT 30"; $result_classified = mysql_query($sql_classified) or die(mysql_error(). " " . mysql_errno()); ?>