Help, there is a table in the database called tasks , you need to write a query so that only those records are displayed in which the date from the termin column was until today.

 $today = getdate(); // получаем сегодняшнюю дату $result = mysqli_query($connect, "SELECT * FROM tasks WHERE termin<='$today'"); // датой больше сегодняшной 

In the database, the termin column is of type date

  • I vote against this issue, because title is not informative - 4per

1 answer 1

You can get the current date using the CURDATE() built-in function in MySQL, and you can compare dates with ordinary comparison operators. This query will return all entries from the tasks table, where the termin field contains the current or already past date:

 $result = mysqli_query($connect, "SELECT * FROM `tasks` WHERE `termin` <= CURDATE();"); 
  • thanks, but not >= a <= , I need notes until today - Abmin
  • Aw, for sure. Carefully read your question. Edited the answer. - neluzhin