move column

hello there,
I have one table in mysql and its like this

title
userID
message
username

is it possible to move userID at the top of title using phpmyadmin?
LVL 1
XK8ERAsked:
Who is Participating?
 
UmeshMySQL Principle Technical Support EngineerCommented:
column_type(width)  > check the column defintion and put as it is.

Here is TestCase


show create table table_name;
 
 CREATE TABLE `table_name` (             
              `id` int(11) DEFAULT NULL,            
              `hello` varchar(50) DEFAULT NULL      
            );
 
Now I'd move column hello to FIRST as
 
 
ALTER TABLE table_name MODIFY hello varchar(50) FIRST;
 
show create table table_name;
 
CREATE TABLE `table_name` (
  `hello` varchar(50) DEFAULT NULL,
  `id` int(11) DEFAULT NULL
);

Open in new window

0
 
UmeshMySQL Principle Technical Support EngineerCommented:
Try this..
ALTER TABLE table_name MODIFY userID column_type(width) FIRST;

Open in new window

0
 
UmeshMySQL Principle Technical Support EngineerCommented:
You can run the ALTER statement in phpmyadmin's SQL query window(make sure DB name is selected in left pane)... or you can use any GUI client to run the statement.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.