PDA

View Full Version : How to put R&B in a query?



lz83ny
07-08-2005, 10:39 AM
Is it possible to put r&b in a query without causing it to split to 2 variables? Does anybody know?

The New Guy
07-08-2005, 10:44 AM
"R&B"

blahsdsd

lz83ny
07-08-2005, 11:10 AM
are you sure?

r2d2
07-08-2005, 11:42 AM
You may have to change the '&' to another character, maybe see what PHP's urlencode chucks out?

This is a URL query string you are talking about?

lz83ny
07-08-2005, 11:47 AM
r2d2:yes, it is a url query. Do you think the quotation marks will do it?

Westech
07-08-2005, 12:20 PM
I haven't tested this, but try substituting "&" or "%26" for the ampersand. (Without the quotes."

r2d2
07-08-2005, 12:23 PM
Wel, I just tried it and it doesn't work for me. Firefox changes the " to %22, and IE leaves it as it is, but passes it as \". I.e. they both change them to the character code.

You need to use 'r%26b', where %26 is the code for &. You can use PHP's urlencode to do it for you, and urldecode on the receiving page.

lz83ny
07-08-2005, 01:21 PM
what about the mod rewrite? I want it to work as an url as well.

Westech
07-08-2005, 08:39 PM
Alternately, you could just come up with a new code for R&B for your query strings. Perhaps call it "rnb" and then have your server-side code check for "rnb" and then convert it to R&B? That's the lazy way out that I would take, anyway.

lz83ny
07-09-2005, 06:01 AM
Westech: this seems like the best and easiest solution. Thanks alot.

James
07-09-2005, 06:48 AM
this seems like the best and easiest solution.
Well, we all know what little Albert Einstein said...

lz83ny
07-09-2005, 09:25 AM
What did that plagiarist say, James?

bassplaya
07-16-2005, 10:33 AM
u better use 'r%26b' as it is standart thing