Updated blog.php with database functionality.