August 29th, 2000, 05:07 AM
I have a database with a date field. I want to change it to a text field which can accept null values. What do I do?
August 29th, 2000, 07:00 AM
There is probably an easier way than this but if all else fails - do a dump of the entire table including the structure, change the type of the field - delete your old table and insert the dump (including new table structure) into the 'insert SQL queries' textarea in phpMyAdmin and click GO ! - you should keep all of your data intact assuming the text field is big enough to accommadate the old date data.
Obvious hint - make a copy of your DB first!
August 29th, 2000, 11:25 AM
this should work
alter table tableName change fieldName1 fieldName2 text;