Nestor wrote:
People,

I have the following table:
DROP TABLE IF EXISTS bid;
CREATE TABLE bid (
 bid_id int(11) NOT NULL auto_increment,
 bid_proj_name varchar(100) NOT NULL default '',
 bid_prop_name varchar(100) NOT NULL default '',
 bid_amount varchar(20) NULL default '',
 bid_sub_name varchar(100) NOT NULL default '',
 bid_sub_desc varchar(100) default '',
 bid_sub_amount varchar(20) NULL default '',
 bid_winner tinyint(1) NOT NULL default '0',
 bid_date TIMESTAMP,
 PRIMARY KEY  (bid_id),
 UNIQUE KEY proj_prop (bid_proj_name,bid_prop_name)
) TYPE=MyISAM;


and I am trying toload a file with the following data:
,Construction Management,RCG Consulting,,Orly-Belle,,,,
,Construction Management,RCG Consulting,,American Engineers,,,,

I am using phpmyadmin and the date always gets enter as 00000000000000

What do I need to do to force the current time stamp?
I am using mysql version 4.0.21-standard

Don't specify the bid_date as an empty string - ie take the last "," from the end. The empty string is being converted to '000000' because it's an invalid date.

If you don't specify that column, it will default to 'now()'.

mysql> insert into bid(bid_proj_name) values ('test');
Query OK, 1 row affected (0.00 sec)

mysql> insert into bid(bid_proj_name, bid_date) values ('test 2', '');
Query OK, 1 row affected (0.01 sec)

mysql> select bid_id, bid_proj_name, bid_date from bid;
+--------+---------------+----------------+
| bid_id | bid_proj_name | bid_date       |
+--------+---------------+----------------+
|      1 | test          | 20060706110203 |
|      2 | test 2        | 00000000000000 |
+--------+---------------+----------------+
2 rows in set (0.00 sec)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to