- Home
- Categorie
- Coding e Sistemistica
- PHP
- Estrarre i dati in base al giorno
-
Estrarre i dati in base al giorno
Devo organizzare on orario con arrivi e partenze ed
alcuni orari ci sono solo alcuni giorni della settimana
da principiante con lo script che segue mi sono
imbrigliato da solo$XGIORNO = "$_POST[GIORNO]";
$XMESE = "$_POST[MESE]";
$XANNO = "$_POST[ANNO]";
$DATA = $XANNO."-".$XMESE."-".$XGIORNO;
$NUMGIORNO = date('w', mktime(0, 0, 0, $XMESE, $XGIORNO, $XANNO));SELECT *,
TIME_FORMAT(ORARIO,'%H:%i') as XORARIO
FROM $tabella
where MEZZO like '%$TIPOMEZZO%'
and VETTORE like '%$TIPOVETTORE%'
and PARTENZA like '%$ORIGINE%'
and ARRIVO like '%$DESTINAZIONE%'
and LU = '$NUMGIORNO' (il campo contiene 1 oppure
and MA = '$NUMGIORNO' (il campo contiene 2 oppure
and ME = '$NUMGIORNO' (il campo contiene 3 oppure
and GI = '$NUMGIORNO' (il campo contiene 4 oppure
and VE = '$NUMGIORNO' (il campo contiene 5 oppure
and SA = '$NUMGIORNO' (il campo contiene 6 oppure
and DO = '$NUMGIORNO' (il campo contiene 0 oppure
and DATAINIZIO >= '$DATA'
and DATAFINE <= '$DATA'Help me
Grazie