Your column called 'when' is a reserved word.
Thats my first guess at your problem. I've come across this before with
MySQL accepting column names that are reserved words. Try changing the
column name to something else and try again.

On Thu, 2002-04-18 at 18:34, Leif K-Brooks wrote:
> I have a field in one of my tables called when, which is type timestamp.
> I'm trying to use some of the date functions to get data from it, but it's
> not working.  The return from mysql_error() is not helpful.  Any ideas?
> Here's my query:
> $query = mysql_query("select month(when) as month,year(when) as
> year,dayofmonth(when) as day,hour(when) as hour,minute(when) as
> minute,second(when) as second from table") or print "Error: ".mysql_error(); 
> -- 
> PHP Database Mailing List (
> To unsubscribe, visit:
Paul Edmondson, Software Engineer
Yospace: Creating Value for Wireless
7 The Courtyard, High Street, Staines, UK, TW18 4DR
Tel: +44 1784 466388
Fax: +44 1784 466387

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to