Quote:
|
Originally Posted by kukusz
<snip snip>
If it were the other way around we are kosher, but how do you search in this direction? Meaning, I would have to grab the correct isbn number and remove the dashes for every isbn in my database and match it against the search string. Any ideas? Maybe someone can point me in the right direction?
Thank you anyone who thinks about this 
|
Wouldn't it be easier to store the ISBNs in a format like
0130926418?
You have a function formatISBN() that takes
0130926418 and returns
0-13-092641-8, used when you want to print the numbers in a pretty format. When doing comparisions and lookups you simply use the "raw" format without any dashes. When accepting input from search forms you simply strip away all characters that is not 0-9.
Well, that's how I would have done =)
If you really want to store the numbers in the other format, why not simply
format the incoming (accepted from input form/terminal or where ever input comes into your application) data into a "pretty" ISBN before doing the lookup? That is, doing a lookup on
formatISBN("0130926418") (
0-13-092641-8).