I found a solution that completly solves character encoding problem while you calling your sql queries.
Simply set your character set before you call a sql query.
$myconnection= mysql_connect(DB_SERVER, DB_USER, DB_PASS)
mysql_select_db(DB_NAME, $myconnection) or die(mysql_error());
mysql_set_charset method sets your character set before the calls.
Don't forget to encode your php files to utf-8, or what encoding you want to encode with.