PHP translate my SQL querys??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
miqbm
Forum Newbie
Posts: 3
Joined: Tue Oct 22, 2002 9:05 am

PHP translate my SQL querys??

Post 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!
Last edited by miqbm on Tue Oct 22, 2002 9:50 am, edited 2 times in total.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
miqbm
Forum Newbie
Posts: 3
Joined: Tue Oct 22, 2002 9:05 am

Post 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;
miqbm
Forum Newbie
Posts: 3
Joined: Tue Oct 22, 2002 9:05 am

Post by miqbm »

I've solved my problem!!!!

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