[nycphp-talk] storing last names and suffixes in a db
David Mintz
david at davidmintz.org
Fri Apr 27 16:47:49 EDT 2012
OK, another dull andboring question for you all.
What approach to you use for storing the suffixes that people add to their
names? I'm not talking about degrees and certifications, but things like
'Jr.' and 'Sr.' Until now the app I am revising has been using a sort of
coward's way, simply treating the whole thing as a single lastname field,
as in "Smith, Jr." If you were to search WHERE lastname = "Smith" you
should get "Smith, Jr." because that's the guy's name, isn't it.
I just did ALTER TABLE people ADD COLUMN `suffix`
enum('Jr.','Sr.','III','IV','') DEFAULT '' and plan to see how that goes
until I see a reason to do different. One issue here is when you're
displaying a fullname in all its glory, you need to know whether the suffix
should be preceded by a comma. It's John Q. Public III but John Q. Public,
Jr., isn't it. The rule I think I might apply is if it has a dot as in Jr.
or Sr., it needs a comma.
Any comments?
I've also noticed that only men seem to go in for this grandiosity. What's
wrong with us guys? (Disclaimer to anyone with a suffix: just kidding!)
--
David Mintz
http://davidmintz.org/
Strike down the mandate. Single Payer!
http://www.healthcare-now.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20120427/282854f0/attachment.html>
More information about the talk
mailing list