Jump to content
Max Castril

MySQL change column

Recommended Posts

Hi there

I am using MySQL in "phpmyadmin.eu.ionos.host" and want to change a column to 'UNIQUE' as I don't want to accidentally fill the table with repeat data using an erroneous php loop and each image must be unique.

The table is:  

2        Image           char(200)            utf8_unicode_ci         

SQL won't let me change the column to 'UNIQUE' as it says that there is a duplicate column 'Image'.  The phpmyadmin SQL seems to be trying to add another column, which is what I dont want.

1and1 have very recently changed their software and there seem to be a lot of gremlins in it.  Any comments??

 

Regards

Max 

 

Share this post


Link to post
Share on other sites
ALTER TABLE tablename ADD UNIQUE (Image);

Should be enough, where 'tablename' is the name of the table with 'Image' column in it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×