next Posted July 12, 2008 Share Posted July 12, 2008 i'm trying to create a table, but get an error at this line for some reason: date_registered DATE DEFAULT(CURRENT_DATE) says i have a syntax error. Any ideas how to fix this? Link to comment https://forums.phpfreaks.com/topic/114376-solved-defaultcurrent_date-throws-an-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 12, 2008 Share Posted July 12, 2008 I am guessing that if you would actually post the error or read what it says that it mentions something about not being able to use a function as a default value... The DEFAULT value clause in a data type specification indicates a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column. See Section 10.3.1.1, “TIMESTAMP Properties”. Link to comment https://forums.phpfreaks.com/topic/114376-solved-defaultcurrent_date-throws-an-error/#findComment-588163 Share on other sites More sharing options...
next Posted July 12, 2008 Author Share Posted July 12, 2008 it just said that i have a syntax error at line 6, nothing specific. Thanks for your help, i'll use TIMESTAMP instead. Link to comment https://forums.phpfreaks.com/topic/114376-solved-defaultcurrent_date-throws-an-error/#findComment-588175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.