Php mysql insert UTF-8?

Hello! Im just so frustrated because Iv searched for answer to this for over an hour and Im stuck! I need to execute mysql query through php.. ok it's easy. I have data that requires UTF-8 for characters like "ā", "ņ" etc. When their stored in mysql database they are changed to... show more Hello!

Im just so frustrated because Iv searched for answer to this for over an hour and Im stuck!

I need to execute mysql query through php.. ok it's easy. I have data that requires UTF-8 for characters like "ā", "ņ" etc. When their stored in mysql database they are changed to "?" question marks. I just dont know what to do anymore because I tried exeuting

mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");

before query and after connectiong to database. My tables and fields and everything in Mysql is set to utf8_general_ci.

I just can't find the solution, please help!
Update: and the .php files are also saved in UTF-8
Update 2: Yes I have the database in UTF-8, because from phpmyadmin I can add thous symbols but when I try through php they show up as "?".

Tryed removing all thous SET NAMES UTF-8 etc, but still nothing..
Update 3: Ok Solved the problem with clear head today. I had two mysql_query("SET NAMES 'utf8'"); one on the connect function and other on select. I think they kind a conflicted and now I have only mysql_query("SET NAMES 'utf8'"); at the connect and everything is working.
2 answers 2