SitePoint Sponsor

User Tag List

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

    Question Column specified as Not Null

    I have a column in mysql that is specified as "Not Null" I have noticed that my form fields that map to these columns are able to populate data into the table regardless of the not null, like if I have an email field and I leave that blank on the form then submit well all other data of my form fields populate and I guess I am expecting the behaviour of the not null on the email column to deny data entry for that entire form submission thus record not entered.

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you are probably entering an empty string which is not the same thing as null therefore it is allowing you to store the value of the empty string.

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    NOT NULL doesnt do error checking for you, youll need do that yourself. instead, the NOT NULL definition will tell MYSQL to input an empty string if there is no input (as opposed to NULL).


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
  •