include("scripts/connect_cnext.php");
$sql = "select * from ecn_stories, ecn_catlink, ecn_category where ec_expiredate <= DATE_ADD(CURDATE(), INTERVAL 365 DAY) and ec_expiredate >= CURDATE() and ec_category = 'event' and ec_id = link_storyid and link_catid = cat_id order by ec_expiredate, ec_id";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) > 0) {
$i=0;
while ($row = mysql_fetch_assoc($result)) {
//SHOW THE NEWS ITEMS
extract($row);
?>
}
}?>