0 returned as null in integer field!

Discussion in 'MySQL' started by Sleeping Troll, Sep 16, 2008.

  1. #1
    Sometime this morning my mysql database started returning 0 as a null rather than 0, this has really buloxed up my site! What went wrong and how can I fix it?
     
    Sleeping Troll, Sep 16, 2008 IP
  2. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Look in the Database forum there is someone with Godaddy with the same problem maybe they are relatedl.

    From your story I get the impresion that your data can not be NULL, if this is the case did you create a NOT NULL constraint on the tablecolumn. You save a small bit on storage and the DB can will not store NULL even if you request it. The last part being a protection inline with your designgoal that the data can not be NULL.
    This might even solve your problem since the Db will know that NULL can not be used.
     
    chisara, Sep 17, 2008 IP