Jump to content
Updating IPB tonight Read more... ×

Archived

This topic is now archived and is closed to further replies.

patricksky

the default date setting at creating table

Recommended Posts

I have the following creat table script

 


create table event(

event_id varchar(9) primary key,

title varchar(30) not null,

description text,

photo_dir varchar(8),

date date not null default CURRENT_DATE

);

 

when i run this script, the error occur that related to the CURRENT_DATE. the purpose of the date colume set to default current_date is that if user haven\'t given the date, then set this as system current date.

what is the error using CURRENT_DATE ?

Thx~

Share this post


Link to post
Share on other sites

If I am not wrong I guess it cant be done in mysql

 

when you try to use now() or date() or curdate()

 

it actully sets like this default \'0000-00-00\'

 

I am not sure if there is any way this can be done.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.