GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 16-Nov-2005, 19:20
Error's Avatar
Error Error is offline
Junior Member
 
Join Date: May 2005
Posts: 42
Error is on a distinguished road

MySql CURDATE() error


I have been using the following sql syntax

Code:
SELECT CURDATE(), date_post, username, post, subject, topic, YEAR(CURDATE())-YEAR(date_post) AS year, MONTH(CURDATE())-MONTH(date_post) AS month, DAY(CURDATE())-DAY(date_post) AS day FROM forum ORDER BY date_post DESC
and it works fine on my computer but on my host server it return the following error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(CURDATE())-DAY(date_post) AS day FROM forum ORDER BY date_post

I have made sure that all of the functions work on the server's version of MySql, and I cannot figure out what the error in the syntax is.
  #2  
Old 25-Nov-2005, 20:15
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Re: MySql CURDATE() error


Did you figure this one out? I am just curious because it doesn't seem to be anything wrong with it. If the error report is anything to go by, the DAY() function seems to be a problem. Which version of MySQL?
  #3  
Old 26-Nov-2005, 17:41
Error's Avatar
Error Error is offline
Junior Member
 
Join Date: May 2005
Posts: 42
Error is on a distinguished road

Re: MySql CURDATE() error


My server uses MySql 4.0.25.
You can view the error at http://windslip.worldfreeweb.com/index.php?url=forum
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 16:41
Winsock error when compiling FLTK 2.0 Projects mauriciorossi FLTK Forum 3 16-Aug-2005 11:18
Help with syntax errors PeteGallo C Programming Language 7 08-Aug-2005 21:30
What is "Ambigious symbol" ??*( a compilation error) small_ticket C++ Forum 2 07-Jan-2005 22:10
Can enum have same name as class? crystalattice C++ Forum 3 08-Dec-2004 17:43

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:42.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.