CodeIgniter Forums
Change name of ID field in database - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Change name of ID field in database (/showthread.php?tid=69677)



Change name of ID field in database - glorsh66 - 01-04-2018

I wanna use default CI tools to work with database, but i also want to change name of ID field to something like - private_messages_ID - to make it easier to make Joins and other combined query...
Is there a way?


RE: Change name of ID field in database - InsiteFX - 01-04-2018

You will need to do this using phpMyAdmin or some other tool enter the sql.

Code:
ALTER TABLE `table_name` CHANGE `ID` `private_messages_ID` INT( 11 ) NOT NULL AUTO_INCREMENT

Change table_name to the name of your table.