Eiolon Posted November 5, 2010 Share Posted November 5, 2010 I currently have a table where the name is one column for both the first and last name. Names are entered in the following format: Smith, John I would like to have a column for both first and last name. What would be the best method to splitting the names up so the first and last name ends up in the respective columns? I am trying not to have to retype everything as there are about 300 names. Quote Link to comment https://forums.phpfreaks.com/topic/217872-alter-table-question/ Share on other sites More sharing options...
mikosiko Posted November 5, 2010 Share Posted November 5, 2010 Alter the table (rename current field, add new field) and then use UPDATE to get the right fields values using substring functions http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr Quote Link to comment https://forums.phpfreaks.com/topic/217872-alter-table-question/#findComment-1130817 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.