HEllo all.
I run into a problem with singlequotes and querying.
Help is appreciated, or if anyone have some expirience, this would be fine.
I have cities table (MySQL).
City names are sometimes like:
's-Hertogenbosch (this is a name of actual city in Netherlands) or
Saint David's (this is a name of actual city in Grenada).
A problem is when querying such city name in mysql table like:
where $length is length of prefix inputed and $prefix is prefix inputed (PHP coding, $prefix for example is "s-Hert", or whole name such as "saint david's".
[red]Problem that I get is that if I use ' sign (singlequote), I receive no result from query, as I should.[/red]
This presents a problem.
Charset used for table is Latin 1.
I have no problems with locale specific characters (Swedish, Turkish, Japanese, Eastern European,...).
ONLY PROBLEM IS WITH SINGLEQUOTE.
Any tips or ideas? Thanks.
I run into a problem with singlequotes and querying.
Help is appreciated, or if anyone have some expirience, this would be fine.
I have cities table (MySQL).
City names are sometimes like:
's-Hertogenbosch (this is a name of actual city in Netherlands) or
Saint David's (this is a name of actual city in Grenada).
A problem is when querying such city name in mysql table like:
Code:
"SELECT * FROM cities WHERE left(name,$length)= '$prefix' ORDER BY accent_name"
where $length is length of prefix inputed and $prefix is prefix inputed (PHP coding, $prefix for example is "s-Hert", or whole name such as "saint david's".
[red]Problem that I get is that if I use ' sign (singlequote), I receive no result from query, as I should.[/red]
This presents a problem.
Charset used for table is Latin 1.
I have no problems with locale specific characters (Swedish, Turkish, Japanese, Eastern European,...).
ONLY PROBLEM IS WITH SINGLEQUOTE.
Any tips or ideas? Thanks.