I want to bring data msql
that belongs to a certain codigoId
and is between certain dates, for this I am using this query
.
$sql = "SELECT * FROM ordint
WHERE codigoId = '".$_POST["codigoId"]."'
BETWEEN '".$_POST["from_date"]."' AND '".$_POST["to_date"]."'";
But it is not bringing me the correct data, My tables would be:
codigoId
, f_aprueba
, I need that if there is data between the dates that I am entering with variables and they belong to the codigoID
one that I am also bringing with a variable that shows me only those, but I do not know if I am using correct condition BETWEEN
Someone who can help me, I'm a newbie with fetching data based on conditions.
Your syntax is wrong. You need to add the name of the column where you have stored the dates. Something like that: