Re: Date problem

From: Date: Wed, 09 Apr 2003 17:57:53 +0000
Subject: Re: Date problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-143131@lists.php.net to get a copy of this message
"Philip Olson" <philip@cornado.com> wrote in message news:Pine.BSF.4.10.10304091747070.82105-100000@localhost... > > using the following code i am attempting to print the date according to the > > reult of a query, but it always prints April, any ideas? > > > > settype($month_result, integer); > > $month_result = mysql_result($result, $l, Booking_Date); > > $month = date(F, strtotime($month_result)); > > First, "I am a string" so quote your strings. Second, > tell the list what this prints: > > print $month_result; > > Lastly, you cannot declare types in PHP so using > settype before using $month_result does nothing > although doubtful if it matters, PHP rarely cares > about types. A number is a number. > > Regards, > Philip > > p.s. You may use MySQL instead of PHP for this: > http://www.mysql.com/doc/en/Date_and_time_functions.html > apologies month_result = 4 month = April month_result = 5 month = April etc

« previous php.general (#143131) next »