Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Alter Table

  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    Mumbai,India
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alter Table

    CHANGE THE WIDTH OF COULM USING phpMyAdmin


    In casea field is varchar I can change its width from 50 to 200 (max 255 is pemitted)

    However when I change varchar(200) to Mediumtext(1000) it gives error

    as follow :
    Error
    SQL-query:

    ALTER TABLE fm CHANGE suggestion suggestion MEDIUMTEXT (1000)
    MySQL said: You have an error in your SQL syntax near '(1000) ' at line 1
    Back


    I wantr to make the sizie of field 'suggestion' from varchar(200) to 1000 what is the way ?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Try removing the column and then adding it with the datatype and size that you want.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Alter Table

    ALTER TABLE fm CHANGE suggestion suggestion MEDIUMTEXT (1000)
    MySQL said: You have an error in your SQL syntax near '(1000) ' at line 1
    Back


    I wantr to make the sizie of field 'suggestion' from varchar(200) to 1000 what is the way ? [/B]

    Try not telling it to use mediumtext (1000). MySQL uses that type column as a field up to 16.8MB (16000000 chars or something).

    just use:
    ALTER TABLE fm CHANGE suggestion suggestion MEDIUMTEXT;


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •