how to insert date in mysql table

Posted by mithun1538 on Stack Overflow See other posts from Stack Overflow or by mithun1538
Published on 2010-04-20T15:33:43Z Indexed on 2010/04/20 15:43 UTC
Read the original article Hit count: 257

Filed under:
|

Hello everyone,

I have a mysql table called pollOfTheWeek. It has a column "pollDate" of type date. I have two questions regarding this : 1. I declared the column while creating the table as [pollDate date] What I wanted is that this column be set automatically, when the user doesnt enter any value for this column. How do i declare the column to achieve this?

  1. Assuming that I have the same declaration as above, how do I enter an empty value. I mean if the column was of type varchar, I would enter empty value as " ". But since it is of type date, I get error when I enter the value as " ". How do I enter empty value for the pollDate column?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about date