Jump to content

Recommended Posts

Hi,

 

If you got a table and some rows may contain values and some may not or may never not depending if user wants to provide such details on a form; is it recommended to use DEFAULT NULL for that column?

 

in phpmyadmin when creating/editing a column; it has an option saying Default: with a drop down showing None | As Defined | NULL | Current Timestamp

 

As some users may wish to provide some of there details for there profile and some may not i'm not sure if there is any benefits etc using NULL from drop down box as default. If so why is it recommended to use default NULL, are there any performance gains etc? if there's no benefits i guess i should use None?

Link to comment
https://forums.phpfreaks.com/topic/229028-is-it-recommended-to-use-default-null/
Share on other sites

If you need to the difference between 0 (zero) and unspecified (NULL), then you need NULL.

 

If you need to the difference between '' (blank string) and unspecified (NULL), then you need NULL.

 

Otherwise, don't bother.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.