Update lib/db.php