Answer the question
In order to leave comments, you need to log in
Why doesn't BETWEEN produce a sample within the specified range?
I have 2 dates (the beginning of the last week and the end of the last week) I want to make a selection for the last week by date:
$start_pned = strtotime("last monday midnight");
$end_pned = strtotime("-1 week",$start_pned);
$starts_pned = date("Y-m-d",$start_pned);
$ends_pned = date("Y-m-d",$end_pned);
dates BETWEEN '$ends_pned' AND '$starts_pned'
Answer the question
In order to leave comments, you need to log in
Before messing around with php, you first need to get a working query in SQL
. And only after the query works in the console, transfer it to php.
Now we have no idea at all where the krivoruchko is here - in the database, in the request, in the PHP shit code.
If the question is about between, then it should not contain any PHP.
And there should be sql, and entirely , and not some kind of stub.
And at the same time an example of data from the database
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question