MySQL: NOW() giving me zeros

Posted by Tunji Gbadamosi on Stack Overflow See other posts from Stack Overflow or by Tunji Gbadamosi
Published on 2010-03-29T15:05:14Z Indexed on 2010/03/29 15:13 UTC
Read the original article Hit count: 133

Filed under:
|
|

I have a table which I want to record the timestamp of every order at every insertion time. However, I'm getting zero values for the timestamps.

Here's my schema:

CREATE TABLE IF NOT EXISTS orders(
            order_no VARCHAR(16) NOT NULL,
            volunteer_id VARCHAR(16) NOT NULL,
            date TIMESTAMP DEFAULT NOW(),
            PRIMARY KEY (order_no),
            FOREIGN KEY (volunteer_id) REFERENCES volunteer(id)
            ON UPDATE CASCADE ON DELETE CASCADE)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about timestamp