Re: Date query

From: Date: Sun, 20 Apr 2003 18:26:19 +0000
Subject: Re: Date query
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-144562@lists.php.net to get a copy of this message
(CPT) John W. Holmes already gave a perfect example to you ... SELECT TO_DAYS(Booking_End_Date) - TO_DAYS(Booking_Start_Date) AS Num_Days FROM table Fill in the missing blanks, namely your table name containing these columns and let mySQL do the work for you. The returned value 'Num_Days' will be what you are looking for, or for what you have indicated you are looking. Regards, der Ritter aka: Jason k Larson
sorry I should have explained this more clearly, I have retrieved the values so I have two variables $booking_start_date and $booking_end_date, how can i find out how many days (if any) are betweent these two dates? Thank you for your replies.


« previous php.general (#144562) next »