Update db.php

added DB charset and using PHP 5.3+ const definition