Re: [PHP] mysql date question

2008-01-03 Thread Richard Lynch
On Thu, January 3, 2008 8:30 am, Adam Williams wrote: > I have a field in mysql as shown by describe contract; > > | length_start | date| YES | | NULL > || > > Which stores it in the mysql format of -MM-DD. However, I need > the > output of my selec

Re: [PHP] mysql date question

2008-01-03 Thread Silvio Porcellana
Uhm, a shot in the dark - try: select date_format(contract.length_start, '%m-%d-%Y') as length_start HTH, cheers! Silvio Adam Williams wrote: I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which s

RE: [PHP] mysql date question

2008-01-03 Thread Bastien Koert
no need for quotes select date_format(contract.length_start, '%m-%d-%Y') as length_start from contract where user_id = 1; bastien > Date: Thu, 3 Jan 2008 08:30:55 -0600> From: [EMAIL PROTECTED]> To: > php-general@lists.php.net> Subject: [PHP] mysql date question> > I have a > field in mysql

RE: [PHP] mysql date question

2008-01-03 Thread Jay Blanchard
[snip] I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which stores it in the mysql format of -MM-DD. However, I need the output of my select statement to show it in MM-DD- format. I can sel

Re: [PHP] mysql date question

2008-01-03 Thread Stut
Adam Williams wrote: select date_format('contract.length_start', '%m-%d-%Y') as length_start from contract where user_id = 1; This has nothing to do with PHP, but the first parameter to date_format should not be in quotes. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.p

[PHP] Re: PHP & MySQL DATE comparison

2004-06-16 Thread Torsten Roehr
"Ryan Schefke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > > > I'm pulling a date in the "datetime" format via a MySQL query. Using PHP I > would like to check if that date is prior to today's date. Can someone > please help with this quick question. You could conver

RE: [PHP] MySQL Date

2003-03-19 Thread John W. Holmes
> I have a date stored in a table in my MySQL Database using a DATE type for > the column. > > How can i compare the date in the table to today ... WHERE your_date = CURDATE() ... > e.g. > > $today = mysql_result($result, $i, Booking_Date); > > if($today = *HELP*){ or... if($today == date('Y

RE: [PHP] MySQL Date

2003-03-19 Thread Barajas, Arturo
Shaun, It should be: date("Y-m-d"). MySQL stores the dates as "-mm-dd", and that function returns the current date on the format you need. Check the date() function on the php manual. -- Un gran saludo/Big regards... Arturo Barajas, IT/Systems PPG MX (SJDR) (427) 271-9918, x448 >

RE: [PHP] Mysql date format

2002-11-07 Thread John W. Holmes
> I'm using php with MySql. > I'm migrating an php-oracle application to php-mysql. I need to know if > exists any function in mysql similar to the "to_char" or "to_date" > functions > of oracle; or "format" function of access?. These functions make a date > format or numeric format. > > ex: to_c

Re: [PHP] mySQL date converting

2001-08-07 Thread Bjorn Van Simaeys
Hi, You could write a PHP script to get all the current values (I presume that you've put varchar as datatype), parse them with string functions and convert it in the way you'd like them to be. All this is not so difficult to make. I prefer to store my date/times in the UNIX timestamp form. I u