Pagina 3 di 3 primaprima 1 2 3
Visualizzazione dei risultati da 21 a 26 su 26

Discussione: Problema con date

  1. #21
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    57
    Scusami, ho sbagliato io, questo è il risultato
    8 CORSO OROLOGI prenotazione 2006-10-17 08:00:00 2006-10-26 23 :59:59
    10 IL FARAONE Prenot del santo 2006-10-06 08:00:00 2006-10-15 23 :59:59

  2. #22
    Utente di HTML.it L'avatar di nicola75ss
    Registrato dal
    Nov 2004
    Messaggi
    12,922
    Originariamente inviato da marco60
    niente, sempre tutto bianco
    Ma com'è possibile se a me mostra due record
    Devi solo modificare nome db, utente e pwd
    Codice PHP:
    <?php
    $dal 
    "2006-10-01";
    $al "2006-10-31";
    $DBhost "localhost";
    $DBuser "utente";
    $DBpass "passowrd";
    $DBName "tuo_db";
    $table "extcal_events";
    $conn mysql_connect($DBhost,$DBuser,$DBpass) or die(mysql_error() );
    mysql_select_db("$DBName") or die(mysql_error() );
    $sqlquery "SELECT * FROM $table WHERE end_date between '$dal' and '$al' ";

    $result mysql_query($sqlquery) or die(mysql_error() );
    $records mysql_num_rows($result);
    while (
    $row mysql_fetch_assoc($result) )
    {
    $thename $row['title'];
    $theemail $row['description'];
    $thestartdate $row['start_date'];
    $theenddate $row['end_date'];
    echo 
    $thename.' '.$theemail.' '.$thestartdate.' '.$theenddate.'
    '
    ;
    }
    A me stampa a video questo
    8 CORSO OROLOGI prenotazione 2006-10-17 08:00:00 2006-10-26 23:59:59
    10 IL FARAONE Prenot del santo 2006-10-06 08:00:00 2006-10-15 23:59:59

  3. #23
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    57
    infatti, tutto ok, ho sbagliato io il risultato è giusto

  4. #24
    Utente di HTML.it L'avatar di nicola75ss
    Registrato dal
    Nov 2004
    Messaggi
    12,922
    La query la modifichi così. Se ti servono solo 4 campi non ha senso estrarli tutti.
    Codice PHP:
    $sqlquery "SELECT title,description,date_format(start_date,\"%d-%m-%Y\") as start_date, 
                 date_format(end_date,\"%d-%m-%Y\") as end_date 
                 FROM 
    $table WHERE end_date between '$dal' and '$al' "

    Poi il codice è da migliorare. Era giusto per testarlo.

  5. #25
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    57
    NON HO PAROLE ....
    Grazie a te e a tutto il forum... finalmente ci sono riuscito. Non è facile quando le cose non le sai !!!!
    Grazie Nicola

  6. #26
    Utente di HTML.it L'avatar di nicola75ss
    Registrato dal
    Nov 2004
    Messaggi
    12,922

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.