How to rename column in MySQL???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mishoboss
Forum Newbie
Posts: 1
Joined: Fri Jul 02, 2004 8:01 am

How to rename column in MySQL???

Post by mishoboss »

Hi everyone, I need to rename a MySQL column. I searched in many forums, but nothing. Can anyone help me? Thanks in advance.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Code: Select all

ALTER TABLE `YourTableName` CHANGE `OldColumnName` `NewColumnName` VARCHAR(20) DEFAULT NULL
To make this kind of work easier use phpMyAdmin - http://www.phpmyadmin.net/home_page/
Post Reply