I am using this to query from my table:
$res = $link -> query("SELECT count(*) FROM sales WHERE status='OK'") or die($mysqli->error);
$num_rows = mysqli_fetch_row($res)[0];
$numberOfSales = $num_rows;
In table sales
I also have a column named date datetime
.
I want it to only returns the number of rows where date is the same as the current week number. So if the date column cell has value 2020-08-03 16:25:26
, that converted to week number is 32. I have been looking at strftime("%V",
, but not sure how to proceed. Any tips?