ciao a tutti!
io ho un php che mi genera un xml da un database....
Codice PHP:
<?php
require_once('../../Connections/xxxxxx.php');
$giorno = getdate();
$giornog = $giorno['year'] . "-" . $giorno['mon'] . "-" . $giorno-"7"['mday'];
//begin recordset
$query_mt_select = "SELECT * FROM mt_select WHERE dal<='" . $giornog ."' AND al>='" . $giornog ."' ORDER BY id_mt ASC";
$mt_select = $xxxxxxx->SelectLimit($query_mt_select) or die($company->ErrorMsg());
$totalRows_mt_select = $mt_select->RecordCount();
//end recordset
?>
<?php echo ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); ?>
<mt_chart>
<?php
while (!$mt_select->EOF) {
?>
<?php echo("<song posizione=\"" . $mt_select->Fields('posizione') . "\" artista=\"" . $mt_select->Fields('artista') . "\" titolo=\"" . $mt_select->Fields('titolo') . "\" puntata=\"" . $mt_select->Fields('puntata') . "\" preview=\"" . $mt_select->Fields('preview') . "\" />\n"); ?>
<?php
$mt_select->MoveNext();
}
?>
</mt_chart>
<?php
$mt_select->Close();
?>
questo mi prende la data odierna e mi genera xml aggiornato....
se io volessi dirgli di prendere quello di 7 giorni fa... come posso fare?