DON'T issue both statements!
Don't issue
SET NAMES utf8
SET CHARACTER SET utf8
one after another. It can cause trouble. I already had bad experience with SET CHARACTER SET utf8 right after SET NAMES utf8.
I recommend to issue only SET NAMES ...
MySQL docs has explanations why: http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html
In short: SET NAMES ...
sets connection's charset to the same as client ans result charset. while SET CHARACTER NAME...
sets different connection's charset and collation.
Please read the doc and decide whichever it better in your case. Or even better make a test.