Page 1 of 1

PHP translate my SQL querys??

Posted: Tue Oct 22, 2002 9:05 am
by miqbm
Hello

I have an sql string like this: "Select.... where strCog like '%Barcelona%'"
But, php translates the characters %ba to a symbol.....
I've found this feature with %be (translated to ¾), %ce (translated to 'Î) and so on.

I've found that the problem occurs when i use this:
header("Location:Llistes.php?where=$Cad");
in this point $Cad is a valid SQL query (without translation)
but when i inspect the $where variable in Llistes.php page, the value of $where variable is incorrect.

Please!!! can anybody help me????

Sorry for my poor english... but for now, i need to know how to resolve my problem. Later, i will learn english.....

Thanks!

Posted: Tue Oct 22, 2002 9:11 am
by twigletmac
I think it is unlikely that it is PHP that is doing this, what editor are you using to generate your PHP code?

Mac

Posted: Tue Oct 22, 2002 9:15 am
by miqbm
I'm using PHP coder.
But the SQL string is generated by code.

I'm refer that i have in code the string: "Select * from tblCiutat where strCiutat like '%" and later i add the string 'barcelona%' wich is selected from a combo.

$SQL ="Select * from tblciutat where strCiutat like '%";

$Ciutat = "Barcelona%'"; (the word "Barcelona" provides from a combo)

$SQL.=$Ciutat;

Posted: Tue Oct 22, 2002 10:32 am
by miqbm
I've solved my problem!!!!

The problem was passing variables throguht pages.
I've used urlencode, and now works fine!