SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Null?

  1. #1
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Null?

    I have got a script that i am editing and im wondering how do i make a field null with a script?

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2005
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $varName null

  3. #3
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh soryr i mean how do i make a field null not just enter null as the text just make the field null

  4. #4
    SitePoint Zealot
    Join Date
    Dec 2005
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh right.

    Is this what you mean?

    Code:
    CREATE TABLE Widget_Table (
      widget_id MEDIUMINT(8) NULL
    );
    I think you just specify NULL, instead of NOT NULL after the field dec.

    );

  5. #5
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no i mean i got the table created i need a script that just updates the table as null

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,251
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    UPDATE Widget_Table SET widget_id = NULL
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are very cryptic.
    Do you want to assign NULL to a column in a database table? If so:
    Code:
    UPDATE tablename
    SET columnname = NULL
    WHERE whereclause;
    Birnam wood is come to Dunsinane


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
  •