Jump to content


Photo

the default date setting at creating table


  • Please log in to reply
2 replies to this topic

#1 patricksky

patricksky
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 July 2003 - 11:16 AM

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~
Patrick sky

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 22 July 2003 - 11:42 AM

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.
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 patricksky

patricksky
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 July 2003 - 12:36 PM

i just try this, that seem cannot work......
Patrick sky




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users