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
select
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
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
[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
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
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 select
Hi,
I have checked the recent list archives and looked up various PHP functions.
I know what I want should be simple but, apparently not simple enought for
me.
I have a mysql database that has a date field and a time field.
I want users to be able to enter a date and a time in text boxes on
[snip]
DATE field in a mysql database.
What obvuios thing did I miss? Note I am not using the system date or
time
stamp, these are entered dates.
[/snip]
You're using a DATE field in the MySQL database. MySQL requires an ISO
formatted date unless you manipulate it, such as 2004-09-14
From: Scott Miller [EMAIL PROTECTED]
I have a mysql database that has a date field and a time field.
I want users to be able to enter a date and a time in text boxes on an
html
form and have them end up in the database.
Code examples would be good here. Either way, the format for a DATE field is
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.
Thanks,
Ryan
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 convert it to a
12:43 PM
To: Php-General-Help
Subject: [PHP] PHP MySQL DATE comparison
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.
Thanks,
Ryan
--
PHP
Hi,
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
e.g.
$today = mysql_result($result, $i, Booking_Date);
if($today = *HELP*){
echo you are booked today;
}else{
echo you are free today;
}
thanks
-Original Message-
From: shaun [mailto:[EMAIL PROTECTED]
Sent: Miercoles, 19 de Marzo de 2003 07:19 a.m.
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL Date
Hi,
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
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-m-d'))
Hello,
Please read the below query and the information that I have mentioned. This
is really weird...
select date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-
%m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN
'2003-02-01' AND '2003-02-10')
When it goes to
Hello,
As related to my earlier question
select date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-
%m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN
'2003-02-01' AND '2003-02-10')
The above query is valid but returns 0 because 'dept_date1' is treated as a
string. I
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:
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:
Which method is the best way to store date/time in MySQL and then which PHP
command is the best to use to convert that date to something useful? I'm
having a difficult time figuring out how to reconcile the date in MySQL so
it works with PHP's various date commands, like getdate().
Any
:06 PM
Subject: [PHP] PHP/MySQL -- Date/Time Confusion
Which method is the best way to store date/time in MySQL and then which
PHP
command is the best to use to convert that date to something useful? I'm
having a difficult time figuring out how to reconcile the date in MySQL so
it works
Which method is the best way to store date/time in MySQL and
then which PHP
command is the best to use to convert that date to something
useful?
Get comfortable with MySQL's date functionality and you'll find that you
don't often need to do the date comparisons and manipulation in php
The easiest and my preferred way is to use strtotim method.
This method accepts MySQL format 2002-12-23 and converts it into a UNIX time stamp.
After that you can use the date function to format time as you wish!
Monty [EMAIL PROTECTED] wrote: Which method is the best way to store date/time
Hi again,
A few days ago, I sent in an inquiry (see below) about how to make the date
field in mysql read NULL when the corresponding form field was empty. I
tried the suggestions I received and the following if statements all seem to
still result in a default -00-00 instead of NULL.
/
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
25 matches
Mail list logo