Don´t really want to bother you with these quickies - but:
If i have a result from mysql that is a date (2002-02-09) - how do i change
that into a variable with only the first 7 characters (2002-02)?
Thanks
# Daniel Alsén| www.mindbash.com #
# [EMAIL PROTECTED] | +46 704 86 14 92 #
# ICQ:
Don?t really want to bother you with these quickies - but:
If i have a result from mysql that is a date (2002-02-09) - how do i
change
that into a variable with only the first 7 characters (2002-02)?
SELECT year(data), month (data) from table;
Valentin Petruchek (aki Zliy Pes)
*** Cut the
or:
SELECT LEFT(date, 7) as YearAndMonth FROM table;
Edward
- Original Message -
From: val petruchek [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Saturday, February 09, 2002 2:28 PM
Subject: Re: [PHP] One more quickie
Don?t really want to bother you with these quickies
$qr=select DATE_FORMAT(date_field,\%Y-%d\) as fmt_date from table
$whereclause;
then grab 'fmt_date' from the results...
Don´t really want to bother you with these quickies - but:
If i have a result from mysql that is a date (2002-02-09) - how do i
change
that into a variable with only
4 matches
Mail list logo