I have a table called user_profile with these three columns. What i am trying to do is when i don't specify any value for cover_pic column then it must insert the default random value from the given two values.
Like example sometime it insert ABC.png as default value and sometime XYZ.png.
CREATE TABLE user_profile( profileId int(11) NOT NULL AUTO_INCREMENT, profile_pic VARCHAR(200) DEFAULT "profile.png", cover_pic VARCHAR(200) DEFAULT RAND("ABC.png","xyz.png"), CONSTRAINT pk_profileId PRIMARY KEY(profileId) )ENGINE=InnoDB DEFAULT CHARSET=latin1;
Aucun commentaire:
Enregistrer un commentaire