You must format the date field, so that it only takes the necessary month; I leave you as your query should be with an example
<?php
$fecha = date('m');
$sql_cuenta = $conn->query("SELECT COUNT(*) AS Total FROM prReserv WHERE MONTH(fecha) = '".$fecha."'");
?>
What I did was:
Assuming that the var% co_of% is worth only the numeric of a month, for example 12
I use the function $fecha
so that of the column that has your table with the format like this: MONTH()
just take the value of 17/12/2018 01:12
then proceed to make the comparison
It is assumed that you want to obtain the count of records for a specific month, so it is necessary to use an aggregation function such as 12
that helps to count the values of the table that are previously conditioned for the month that is equal to what you spend
UPDATE
Finally, in order to show the results, you can do something like the following
$fila = mysqli_fetch_array($sql_cuenta);
echo $fila["Total"];
In the previous code as you can see to be able to print the total of
records of the month in question I used the alias COUNT()
that
declare the use of the function Total