I m creating a PHP function. This function get data from MySql Database. This is the query:
$sqlScontrini= "(SELECT c.CodScontrino as codScontrino, DATE_FORMAT(c.DATA, '%Y-%m-%d %H:%i:%S') as data, ALIQUOTAIVA as aliquotaIva,
CODICESCONTO as codiceSconto, CODSCONTRINOREGCASSA as codScontrinoRegCassa,TOTALE as totale,
DATE_FORMAT(c.DATA, '%Y-%m-%dT%H:%i:%S') as dataFunction
FROM codscontrini".$suffissoTabella ." AS c
INNER JOIN totscontrini".$suffissoTabella ." AS t on c.CodScontrino = t.CodScontrino and
c.DATA = t.DATA
WHERE TRIM(CODSCONTRINOREGCASSA) IN (".$elencoCodici.")
ORDER BY c.DATA)";
while($row = $result_Scontrini->fetch_assoc()) {
echo $row['data'];
}
Now if I try to execute the code, I can read the Date in this format:
2024-07-30 19: 51: 32
2024-07-30 20: 23: 12
I need to remove the white space after “:” character, but I m not able to do this.
How can I fix it?
1