I have the following sql script:
CREATE TABLE `akalogixDB`.`users` (
`user_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`priv_id` INT NOT NULL DEFAULT '3',
`username` VARCHAR( 40 ) NOT NULL ,
`password` VARCHAR( 40 ) NOT NULL ,
`email` VARCHAR( 40 ) NOT NULL ,
`first_name` VARCHAR( 40 ) NULL ,
`last_name` VARCHAR( 40 ) NULL ,
`avatar` VARCHAR( 100 ) NULL DEFAULT 'images/avatars/no_avatar.jpg',
`mini_avatar` VARCHAR( 100 ) NULL DEFAULT 'images/avatars/no_avatar_mini.jpg',
`about` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL ,
`user_folder` VARCHAR(100) NOT NULL DEFAULT ====> #here is the problem
UNIQUE (
`username` ,
`email`)
) ENGINE = MYISAM ;
I would like to give the default value for user_folder the following: 'users/folders/'+user_id + current timestamp How can I do this, I know that I can do it with PHP, but is there way of doing with sql instructions.
user_foldershould be something likeusers/folders/123/2006-02-22 16:26:08.037. The value 123 is the auto-incremented value of theuser_id.