Recordset to filter current events OR current ads
On this page http://communityhotline.com/Member-Posts/ads-events-news.php?SI=&Search=1&theme=default I am successfully filtering to current eventdates with this SQL AND the search works.
On this page http://communityhotline.com/Member-Posts/ads-events-newsTesting.php?SI=&Search=1&theme=default
my search breaks and returns all results
$query_WADAtbl_posts = "SELECT * FROM tbl_posts WHERE enddate >= CURDATE() OR adexpires >= CURDATE() AND displaylevel = '0' ORDER BY postid DESC";
$query_limit_WADAtbl_posts = sprintf("%s LIMIT %d, %d", $query_WADAtbl_posts, $startRow_WADAtbl_posts, $maxRows_WADAtbl_posts);
$WADAtbl_posts = mysql_query($query_limit_WADAtbl_posts, $community) or die(mysql_error());
$row_WADAtbl_posts = mysql_fetch_assoc($WADAtbl_posts);
I adjusted the SQL to take out: OR adexpires >= CURDATE() and the page works. We have a post table so that members can create one post which has the ability to display as and ad, event and news if all the criteria is met. This page shows all 3, ads, events and news and I want to display posts with event dates greater than or equal to today.
Connection and DB info attached.