Reputation: 2430
Is it possible to change the order of columns in MySQL (using phpMyAdmin XAMPP) by which they appear without dropping the current table?
Upvotes: 5
Views: 6885
Reputation: 6157
How to do it by using PhpMyAdmin:
Done!
Upvotes: 2
Reputation: 1964
Try this
ALTER TABLE `table_name`
MODIFY COLUMN `column_name1` varchar(100) AFTER `column_name2`;
Upvotes: 11
Reputation: 835
I'm not sure about phpMyAdmin, but you can certainly do that with an SQL query:
ALTER TABLE `table`
CHANGE COLUMN `oldname` `newname` *column_definition* [AFTER|BEFORE] `colname`;
Upvotes: 5