Update db.php

trigger_error replaced with exceptions