Rogue3 Posted July 6, 2006 Share Posted July 6, 2006 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? Quote Link to comment Share on other sites More sharing options...
obsidian Posted July 6, 2006 Share Posted July 6, 2006 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. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 6, 2006 Share Posted July 6, 2006 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. Quote Link to comment Share on other sites More sharing options...
Rogue3 Posted July 6, 2006 Author Share Posted July 6, 2006 Well, the field that can sometimes be left blank is going to be a searchable field, but not a field that will display on the results page. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 6, 2006 Share Posted July 6, 2006 Doesn't matter what the public sees... it only matters if you need to know the difference. Quote Link to comment 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.