I found the only way to do this through an external file. This is my explanation:
function changeSchema($oldName, $newName, $type, $len) { $res = mysql_query("SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = '$oldName' AND TABLE_SCHEMA = 'your_database_name'"); if($res) while($line=mysql_fetch_object($res)) mysql_query("ALTER TABLE `$line->TABLE_NAME` CHANGE `$oldName` `$newName` $type( $len ) NOT NULL "); } }
Then I was able to change any table that I wanted easily.
Raath source share