开发者

Unable to set a URL as Default value in MySQL

I am using phpMYAdmin to set a URL as a Default Value to a Field of a Table in MySQL database, but of no luck.

The UR开发者_StackOverflowL is like this one:

http://www.kaboodle.com/hi/img/c/0/0/b2/9/AAAADMEBXEUAAAAAALKWPw.jpg

Here is the Table field structure:

{varchar(255), utf8_general_ci, Not Null}


It's unclear what is wrong, but this will create a DEFAULT constraint for an existing table using an ALTER TABLE statement to to set the URL value if one is not provided when a record is inserted:

ALTER TABLE your_table 
ALTER the_column SET DEFAULT 'http://www.kaboodle.com/hi/img/c/0/0/b2/9/AAAADMEBXEUAAAAAALKWPw.jpg'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜