Re: [PHP] Problem with SQL query

2002-07-09 Thread Richard Lynch
LIMIT was not included in the SQL92 SQL standards and very few vendors implement all of SQL99; the use of ANSI standards to promote portable programs has always been beset by this kind of problems. Wow! There's actually an SQL99 that vendors are targeting, kinda sorta? Hey, with any luck, but

Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra
ðÒÉ×ÅÔ! I can't figure out what is wrong with this: $query = select count(*) as monthly_views from visitors group by extract('year', time), extract('month', time) order by monthly_view desc limit 1; AFAIK this is no ANSI SQL, which is why is not portable. Your query should really be

Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra
ðÒÉ×ÅÔ! I forgot to add: SELECT extract('year', time), extract('month', time), count(*) as monthly_views FROM visitors group by extract('year', time), extract('month', time) order by monthly_view desc limit 1 I take it that you have a *monthly_view* column in your

Re: [PHP] Problem with SQL query

2002-07-07 Thread JJ Harrison
Thanks for giving me something to look up :) -- JJ Harrison [EMAIL PROTECTED] www.tececo.com Alberto Serra [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ðÒÉ×ÅÔ! I forgot to add: SELECT extract('year', time), extract('month', time), count(*)

Re: [PHP] Problem with SQL query

2002-07-07 Thread JJ Harrison
No matter what I try I still seem to get the error message. The coloumn that contains the dates has unix timestamps. I think this is why it is not working. I will research it further. If you can be of any help please tell me. -- JJ Harrison [EMAIL PROTECTED] www.tececo.com Alberto Serra

Re: [PHP] Problem with SQL query

2002-07-07 Thread JJ Harrison
I have fixed it now don't worry! -- JJ Harrison [EMAIL PROTECTED] www.tececo.com Alberto Serra [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ðÒÉ×ÅÔ! I forgot to add: SELECT extract('year', time), extract('month', time), count(*) as

RE: [PHP] Problem with SQL query

2002-07-07 Thread Mark Charette
LIMIT was not included in the SQL92 SQL standards and very few vendors implement all of SQL99; the use of ANSI standards to promote portable programs has always been beset by this kind of problems. Mark Charette Former ANSI X3H3.1 member -Original Message- From: Alberto Serra

Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra
ðÒÉ×ÅÔ! Mark Charette wrote: LIMIT was not included in the SQL92 SQL standards and very few vendors implement all of SQL99; the use of ANSI standards to promote portable programs has always been beset by this kind of problems. Yes, and vendors just love to have proprietary standards to