[BNM] PHP and MySQL dates

Alex alex at fatdrop.co.uk
Fri Nov 7 15:23:31 GMT 2008


hehe always the way...

btw, if your id field is an integer you should be doing WHERE id = 80 
instead of '80'

=]



Catherine Pope wrote:
> Please ignore me.  In the time-honoured tradition, it worked just after I
> posted the message.  I'm not entirely sure why, however.  I blame evil
> code-changing pixies.
>
> Catherine
>
> 2008/11/7 Catherine Pope <me at catherinepope.co.uk>
>
>   
>> Hello Folks
>>
>> I'm hoping one of you clever sticks can show me where I'm going wrong.  I'm
>> trying to retrieve a date from a datetime field called 'created' and then
>> format it using DATE_FORMAT. I'm using the following query:
>>
>> SELECT DATE_FORMAT(created, '%D %M %Y') AS created FROM cms_bookmarks WHERE
>> id = '80'
>>
>> It works fine when I run it directly on the database in phpMyAdmin but
>> doesn't return a value when I use it in my PHP code.  All my other queries
>> are working fine, so I'm fairly sure that the other syntax is correct.
>>
>> Am I doing something stupid?
>>
>> TIA
>>
>> Catherine
>>
>>     

-- 
http://www.fatdrop.co.uk - digital music services
http://blog.fatdrop.co.uk - music industry blog

FATDROP LTD | Registered in England and Wales | Company No. 6199983



More information about the BNMlist mailing list. Powered by Wessex Networks