Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP myAdmin - Change Field Order (Move Up Or Down)

How do I change the order of my table fields without deleting the field and re-inserting it, using PHP myAdmin?

like image 472
Joshua Avatar asked Dec 26 '09 02:12

Joshua


People also ask

How do I change the order of columns in PhpMyAdmin?

phpMyAdmin has finally included this feature in the most recent version (4.0 and up). Go to the "Structure" view for a table, click the Change button on the appropriate field, then under "Move column" select where you would like the field to go. Yay.

How do I rearrange tables in PhpMyAdmin?

In phpMyAdmin go to table structure. On bottom you can press option "Move columns" There you can rearange tables as you see fit. That one is for rearranging columns, not the tables themselves.

How do I change the order of rows in MySQL?

An "ALTER TABLE ORDER BY" statement exist in the syntaxes accepted by MySQL. According to the documentation, this syntax: - only accept *one* column, as in "ALTER TABLE t ORDER BY col;" - is used to reorder physically the rows in a table, for optimizations.

How do I reorder columns in MySQL?

Go to Structure and click Move Columns and then just drag the columns to rearrange.


1 Answers

ALTER TABLE `table_name` MODIFY `column_you_want_to_move` DATATYPE AFTER `column` 

DATATYPE is something like DATETIME or VARCHAR(20) ..etc

like image 75
Populus Avatar answered Sep 22 '22 03:09

Populus