declared utf charset in the connection string

Also updated code example to match phpbestpractices.org example