I have this query:
$sql = "SELECT * FROM giorni WHERE punto = '$punto' && STR_TO_DATE(giorno, '%d/%m/%Y') ...
I need to do a similar query for the previous year. How can i do %Y-1
?
You can simply subtract 1 year from the converted date:
... STR_TO_DATE(giorno, '%d/%m/%Y') - INTERVAL 1 YEAR