smith.james0 Posted July 7, 2006 Share Posted July 7, 2006 HiI need to move two columns (area_servicability, company_servicability) to a new table without lossing the data, is this possible in php admin?Second question If i change the column type will it keep all the date? (varchar(200) change to int(5,2))Thanks James Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/ Share on other sites More sharing options...
cmgmyr Posted July 7, 2006 Share Posted July 7, 2006 James, If you have phpMyAdmin, select the table you want to move/copy, select Operations on the top, go to Copy table to (database.table): select the database you would like it to be copied to, type in the name of the table, make sure you have structure and data selected and push go!If you don't have phpMyAdmin, either install it or let me know and I can give you the sql query.hope this helped,-Chris Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/#findComment-54490 Share on other sites More sharing options...
smith.james0 Posted July 7, 2006 Author Share Posted July 7, 2006 Is it possible to copy just two columns rather than the whole table?Thanks James Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/#findComment-54552 Share on other sites More sharing options...
kenrbnsn Posted July 7, 2006 Share Posted July 7, 2006 Copy the whole table and then delete the columns you don't want.Ken Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/#findComment-54604 Share on other sites More sharing options...
Barand Posted July 8, 2006 Share Posted July 8, 2006 [quote author=smith.james0 link=topic=99806.msg393225#msg393225 date=1152295491]Second question If i change the column type will it keep all the date? (varchar(200) change to int(5,2))[/quote]valid integer values should be retained. What is int(5,2)? Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/#findComment-54717 Share on other sites More sharing options...
Daniel0 Posted July 8, 2006 Share Posted July 8, 2006 [quote author=Barand link=topic=99806.msg393477#msg393477 date=1152349816][quote author=smith.james0 link=topic=99806.msg393225#msg393225 date=1152295491]Second question If i change the column type will it keep all the date? (varchar(200) change to int(5,2))[/quote]valid integer values should be retained. What is int(5,2)?[/quote]I believe int(5,2) would be an integer of that is 5 characters long with 2 decimals - but then it's a float and not an integer :S ??? Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/#findComment-54837 Share on other sites More sharing options...
smith.james0 Posted July 9, 2006 Author Share Posted July 9, 2006 Thanks for that worked first time. int(5,2) sorry I ment decimal(5,2)Thanks James Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/#findComment-55085 Share on other sites More sharing options...
Daniel0 Posted July 9, 2006 Share Posted July 9, 2006 Ahh, well then it makes sense. Quote Link to comment https://forums.phpfreaks.com/topic/13966-moving-db-colums-to-a-different-table/#findComment-55189 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.