Hey all,
I am trying to select articles from a field called date(datetime) for the current month and year. This is my query:
SELECT id,date_FORMAT(date,'%m/%d/%Y at %l:%i:%s %p') AS n_date, title, teaser, news FROM news WHERE MONTH(date) = '". date('m') ."' AND YEAR(date) = '". date('Y') . "' ORDER BY date DESC LIMIT $start, $max_per_page
I should note that this query is inside a pagination code to display articles 10 at a time. What happens is, the code displays the articles for the current month and year, with the pagination limit of 10 at once, but then when there are no articles left for the month and year, it continues the pagination for some reason, but the page will be blank. Please help.