Andrew
Andrew

Reputation: 243

How can I put mysql existing columns in new order on phpmyadmin by a practical way?

I know long way to change them but I have so many tables I have to edit. It takes so much time.

Does anyone know how to put them order by a practical way?

Upvotes: 1

Views: 674

Answers (2)

Madhura Jayaratne
Madhura Jayaratne

Reputation: 2284

As of phpMyAdmin version 4.0.0 you can easily rearrange the column order by dragging and dropping. Click on the Move columns link in the table structure page and rearrange the column order in the popup dialog.

enter image description here

Upvotes: 0

Edper
Edper

Reputation: 9322

As far as phpmyadmin there is none but you could do it programmatically via SQL like:

ALTER TABLE Table_Name_Here MODIFY COLUMN column4 int(11) AFTER column2

or

ALTER TABLE Table_Name_Here MODIFY COLUMN column4 int(11) FIRST

Upvotes: 2

Related Questions