Martin Cooper
Martin Cooper

Reputation: 11

Converting varchar to int using phpmyadmin

I'm trying to convert a table from varchar to int. The reason for this is because I'm trying to order the numbers on my website by the highest first. That's not the problem but because it's a variable it's ordering them wrong.

When I try changing the table in PhpMyAdmin to an INT I get this error:

1283 - Column 'referrals' cannot be part of FULLTEXT index

Maybe there's a query I have to put in. All help is much appreciated.

Upvotes: 1

Views: 2251

Answers (2)

Jabulani
Jabulani

Reputation: 76

You can also use the myadmin interface to do the changes.

Just go to the Table you wish to change and click on it. then go to structure on the menu tabs at the top. and click change next to the field you would like to change. it will allow you to modify everything about that field and the table.

Upvotes: 0

OMG Ponies
OMG Ponies

Reputation: 332571

You have a full text index associated with your referrals column that needs to be dropped before the data type change will successfully execute:

ALTER TABLE your_table DROP INDEX (fulltext_index_name);

But check before you drop the index to see if it references other columns in the table, because you'll need to recreate the index (excluding the referrals column) for Full Text Search to work.

Upvotes: 2

Related Questions