mysql 'like' query problem for greek characters in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kashyap
Forum Newbie
Posts: 1
Joined: Sat Nov 21, 2009 8:34 am

mysql 'like' query problem for greek characters in php

Post by kashyap »

hi,

When i run this qurey in mysql :-
SELECT id, title
FROM movie
WHERE title LIKE 'δ%'
LIMIT 0 , 30

then out put :-
id title
1 δοκιμή 123
2 δοκιμή


but when i run it in php then there is no any result
how to solve this problem..........?

Plz help me to solve it...........
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: mysql 'like' query problem for greek characters in php

Post by iankent »

Assuming the columns etc are all using the correct charset, try setting the charset before using your SELECT query:

Code: Select all

SET NAMES utf-8;
replacing utf-8 with whichever charset you need
Post Reply