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
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
Ma com'è possibile se a me mostra due recordOriginariamente inviato da marco60
niente, sempre tutto bianco
Devi solo modificare nome db, utente e pwd
A me stampa a video questoCodice 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.'
';
}
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
infatti, tutto ok, ho sbagliato io il risultato è giusto
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.
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