= CURDATE()"; $countq = mysql_query($countsql); $count = mysql_result ($countq,0); //records per page $per_page = 10; //starting record for this page $start = $page * $per_page ; if ($start > $count) { echo "No more records
\n" ; $page = ceil ($count / $per_page ); } else { $story = "select * from ecn_stories where ec_type = 'EVENT' and ec_expiredate >= CURDATE() ORDER BY ec_expiredate, ec_id ASC LIMIT $start,$per_page"; if (!$results = mysql_query($story)) { $title = "Sorry, there are no stories to display in this category."; } else { $title = "Listing for Events"; } } ?> <? echo "$title"; ?>
$title"; ?> $headline
"; echo "Event Dates: $eventdates
"; if (isset($body)) { echo "$body
"; } echo "
"; } } else { echo "

No results to display

"; } if( $page > 0) { $prev = $page - 1; echo "<<Previous
\n "; } if($start + $per_page < $count ) { $next = $page + 1; echo "Next>>
\n "; } ?>