views:

20

answers:

1

ok.. Im a complete noob at SQL and having trouble... Im trying to convert a table from varchar to int.. The reason for this is because Im trying to order the numbers on my website by the highest first.. Thats not the problem but because its a varible its odering 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 theres a query I have to put in.. All help is much appreciated. Sorry for being such a beginner.

+2  A: 

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.

OMG Ponies
Thankyou for your reply!!Im sure it works I just need a little more help.. I've used your solution like this ALTER TABLE referrals DROP INDEX (fulltext_index_name) do I have to put something into the index_name bit? Thankyou!
Martin Cooper
@Martin Cooper: Yes, you need to specify the name of the full text index that referrals is attached to. Use the [SHOW INDEX syntax](http://dev.mysql.com/doc/refman/5.0/en/show-index.html) to find the name. You want to look at your table in particular, where the `index_type` is "fulltext".
OMG Ponies
Hmm.. I get this error 1142 - SELECT command denied to user '***********' for table 'pb_users'
Martin Cooper
@Martin Cooper: You need to use an account with higher privileges, or increase the privilege to the `pb_users`
OMG Ponies
Hmm.. This is the account 1and1 have given me.. I am the main admin.. Ok well I have the solution. Thankyou you've been VERY helpful!!! Much appreciated!
Martin Cooper