I have a database schema for users. Looks like...
CREATE TABLE `users` ( `id` int( 8 ) unsigned AUTO_INCREMENT, `username` varchar( 255 ), `password` varchar( 40 ), `level` tinyint( 1 ) unsigned DEFAULT 1, `time` datetime DEFAULT NOW(), `email` varchar( 255 ), PRIMARY KEY (`id`) ) ENGINE=InnoDB;
There are six fields: id, username, password, level, time, email, but I want to insert only three of them - when the user logs in: username, password and email address. The rest of them will have default values.
The problem is that MySQL throws an error: # 1067 - Invalid default value for 'time' . Any ideas guys?
source share