#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    na
    Posts
    1
    Rep Power
    0
    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?

    Regards

    James

    jtf@england.com
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    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!

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    RyanP
    Guest
    Devshed Newbie (0 - 499 posts)
    this should work

    alter table tableName change fieldName1 fieldName2 text;

Similar Threads

  1. Codepupil
    By Adachic in forum C Programming
    Replies: 3
    Last Post: February 6th, 2004, 07:50 PM
  2. Replies: 3
    Last Post: January 31st, 2004, 01:16 AM
  3. changing image src with input field and javascript
    By benthekiller in forum JavaScript Development
    Replies: 4
    Last Post: January 15th, 2004, 03:19 AM
  4. return value from 3 fields into 1 field
    By denali in forum MS SQL Development
    Replies: 1
    Last Post: December 19th, 2003, 08:44 AM
  5. WHM account creation error messages on RH
    By borisbaloney in forum Linux Help
    Replies: 0
    Last Post: December 16th, 2003, 07:54 PM

IMN logo majestic logo threadwatch logo seochat tools logo