php - Compare date and time to current time in MySQL

one text

Solution:

You can get cuttent_date() and current_time() like this:

$sql = "SELECT * FROM p_appointment WHERE date >= current_date() AND time >= current_time() ORDER BY date,time ASC

Also you shouldn't fetch all data from database if you have a lot of records (>100). It is a good practice to use LIMIT to get only part of records and perform pagination for records.

Source