![]() |
MYSQL, pipe delimited or just spaces?
One of my projects is going to require a search.
I have members who have and use multiple names. Some of these names use spaces or hyphens, and I believe some may use commas. my issue is that, i have no controll over these user names, as the way that it is designed is so that they match the names that they use on a different site, wich has no rules set as to their structure. they may have the following names kitty cat cat kittycat so, how I would like for this to work is that their is one field where these names are entered, and that these names can be updated as well. when I search, it would search these fields, first by the exact phrase put in the search field and then, by the word appearing somewhere within the name. So if someone typed CAT in the search field, it would return, all three results and it would sort them to this order cat kitty cat kittycat My question is, in what way should I structure these fields? I was thinking that, since rarely would one use the pipe | key for their username, I could tack that on. so the field would read like this cat|Kittycat|kitty cat I would want to make sure that when they are entering their names into their personal profile, that whitespace that follows the name, in case they accidently hit the space bar, or copy it from somewhere that tacks on whitespace, is not inserted, so we don't get something like cat |kittycat I know how to make sure to tack on the | when they are updating their profile, but, how do you, make it so that it searches each record keeping in mind the pipe. And then, how do you make sure to take the pipe out when posting the response to the query. Am I thinking about this too hard? Since I have unlimited databases on my server, do you think it would be better if I just had a table for this purpouse and connected it based on a server generated index number? What do you think? Thanks in advance Mike |
| All times are GMT -5. The time now is 11:56 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC