PHP: Problems comparing data from a DB with data from http request
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
PHP: Problems comparing data from a DB with data from http request
Hi!
I'm trying to compare data that's coming from a DB with data from one http request.
When I use plain old ascii data, I have no problem comparing both, however, when I try to use the string "Universidad Pedagógica Nacional", I can't tell when there's a match between the two. Just to see what was going on, I tried to compare the rawurlencode of both strings, and then I noticed that both string are not exacly equal. See what both values would be:
First you need to decide which lang you are going to use internally (English or Spanish), then ensure that any entered data is re-rendered into that lang/alphabet.
Or ensure all data entry uses the same UTF encoding std. Unfortunately, there is more than one UTF encoding avail... http://en.wikipedia.org/wiki/Compari...code_encodings
Thanks for your swift replay, man. I just noticed that I won't have a problem with that, cause the data that will be provided in the http request will be like the data in the DB (just changed the parameter to what the rawurlencode function said it was and then the match happened! Cool! Now I don't have problems with accents:
Every one works... except for the ones that have a ' or " in the name (like McDonald's, or D'Candido)
I guess I'll have to take a closer look at it tomorrow (it's already late at night here so I'm heading to bed... anyway, take a look to see what you can think of).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.