Problem with mysql

Asked

Viewed 62 times

0

I wonder what I can do for the mysql recognize the "+" character, because it shows in a part of my site the name with the "+" and when I make a request in $_GET I need to recover this name by url but he does not recognize what I could do for him to recognize the sign of "+" in url?

This and the page before clicking the read more button. it is calling normal the name. inserir a descrição da imagem aqui

Now this is the page when you click on the button read more it is not recognizing the "+" sign, because I only removed it and recognized what I could do to recognize it? inserir a descrição da imagem aqui

1 answer

1

I know the problem has been solved but I’ll leave one more option and try to explain the first.

urlencode(): Basically transforms white spaces into a sum signal +, is used more in search fields, forms. Special characters are %seguido de dois dígitos

rawurlencode() Turns white spaces into %20 but also transforms accents, special characters into %seguido de dois dígitos.

Examples

We have on the server-side

echo "http://algumsite.com.br"
. "/categoria/" . rawurlencode("últimas notícias")
. "/busca?q=" . urlencode("situação do Brasil");

And the result in the client-side is the second:

http://algumsite.com.br/categoria/%C3%BAtimas%20not%C3%ADcias/busca?q=situa%C3%A7%C3%A3o+do+Brasil

That’s basically it, if you have any more questions you can leave in the comments.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.