jeff5656 Posted November 17, 2008 Share Posted November 17, 2008 If I change a variable from VARCHAR to TEXT, does that erase all the data in that field? Quote Link to comment https://forums.phpfreaks.com/topic/133131-changing-field-type/ Share on other sites More sharing options...
flyhoney Posted November 17, 2008 Share Posted November 17, 2008 If you go from VARCHAR to TEXT, im pretty sure it does not. You should probably just create a table and test it real fast though. Quote Link to comment https://forums.phpfreaks.com/topic/133131-changing-field-type/#findComment-692342 Share on other sites More sharing options...
Mchl Posted November 17, 2008 Share Posted November 17, 2008 * When you change a data type using CHANGE or MODIFY, MySQL tries to convert existing column values to the new type as well as possible. Warning: This conversion may result in alteration of data. For example, if you shorten a string column, values may be truncated. To prevent the operation from succeeding if conversions to the new data type would result in loss of data, enable strict SQL mode before using ALTER TABLE (see Section 5.1.7, “SQL Modes”). Quote Link to comment https://forums.phpfreaks.com/topic/133131-changing-field-type/#findComment-692385 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.