I have a two DATETIME columns: event_start and event_end. I’m not sure why this isn’t working.
SELECT * FROM ibclc_schedules WHERE NOW() >= event_start AND NOW() <= event_end ORDER BY event_start ASC LIMIT 1
I get a “Notice: Trying to get property of non-object” printed to the screen.
I suggest you to debug current datetime of mysql server with query
SELECT NOW();
and check it is really between event_start and event_end of your needed result.i think this is a php error kindly check your php code or write your code here so we have an idea about that, or first check this query in phpmyadmin weather its returning something or not