SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    273
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry setting null to not null how?

    Hey Guys

    i have a mysql table.. (duh!)

    a field in it is set to null and i want to unset it to make it not null.

    how do i do that ? by default it takes null values (its weird.. default is null while null column is a no.. so it cant take null values!)

    how do i reset the null column to yes so it can take null values.
    please assist

    thanks
    rj

  2. #2
    SitePoint Zealot cholmon's Avatar
    Join Date
    Mar 2004
    Location
    SC
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    something like this:


    ALTER TABLE `table` CHANGE `column` `column` VARCHAR( 4 ) NOT NULL
    Drew C King: PHP Developer
    <?= $short_tags++ ?>

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    NULL vs. NOT NULL does not determine whether NULL means YES or NO, it determines whether you can store a NULL value in the column or not.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast


Bookmarks

Posting Permissions

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