I have a database with Name (aseguradora), Price (Precact) and Date (Ultdato). $matriu1 is a variable (table from datatable). Id is a variable (date selection from user)
I want to select the max and min price and date from both to show it, but the date not show the correct date. I think that I need to create a subquery, but I'm not sure. Any help? THANKS!
$sqle= "SELECT MIN(Precact), Ultdato
FROM $matriu1[3]
WHERE Aseguradora = '$aseguradora' AND Id <= '$fecha'"; // Seleccionem el valor mínim
$sqlf= "SELECT * MAX(Precact), Ultdato
FROM $matriu1[3]
WHERE Aseguradora = '$aseguradora' AND Id <= '$fecha'"; // Seleccionem el valor màxim