PHPFAN10 Posted February 27, 2011 Share Posted February 27, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/229028-is-it-recommended-to-use-default-null/ Share on other sites More sharing options...
fenway Posted February 27, 2011 Share Posted February 27, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/229028-is-it-recommended-to-use-default-null/#findComment-1180524 Share on other sites More sharing options...
PHPFAN10 Posted February 28, 2011 Author Share Posted February 28, 2011 Thanks for the reply Quote Link to comment https://forums.phpfreaks.com/topic/229028-is-it-recommended-to-use-default-null/#findComment-1180720 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.