Hello, how to read the number of lines where the month in `date_cancel` is equal to the current month.The date in the database is written as" 1562529530".
How do I make a request to the database? Like this:
$AllOrder=mysqli_fetch_row(mysqli_query($mysqli,"SELECT COUNT(` id`) FROM `orders` WHERE` date_cancel` IS null"));

1 Answers 1

SELECT COUNT(*) FROM `orders` WHERE` date_cancel` BETWEEN UNIX_TIMESTAMP(DATE_FORMAT(NOW(),'% Y-% m-01')) AND UNIX_TIMESTAMP();