Jump to content

When to use the 'null' option


Rogue3

Recommended Posts

I have a field in my form (varchar(80)) that I don't always enter information for. It's an "additional keyword" field used to put additional keywords for my search form. Right now I have it to where it is just blank, but should I have it set to 'null' if there is no info there? Will this affect the search one way or the other?
Link to comment
Share on other sites

it won't affect the search, really, but it may help in your queries to have it NULL as opposed to an empty string. they [b]are not[/b] the same thing. an empty string still has memory allocated to store it, while a NULL is a truly empty value. setting your table to default NULL is usually a good idea.
Link to comment
Share on other sites

Having NULL-able fields make a big difference... use it only when you actually care about knowing that values where unspecified vs. blank.  Otherwise, it makes querying, indexing, joining, etc. more complicated.
Link to comment
Share on other sites

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.