O'Reilly logo

PHP and MongoDB Web Development by Rubayeet Islam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - building the Blog Dashboard

In this example, we are going to build the Blog Dashboard, a page that lists most recently saved articles first, showing five articles at a time. The user is able to browse through all articles using the navigation links at the bottom of the list. For now we will not implement any functionality in the dashboard other than viewing each article. Moving forward in this chapter, we will use this page as our codebase to build on top of as we learn more advanced MongoDB topics:

  1. Create a new file named dashboard.php in your text editor, and add the following PHP, HTML/CSS code there:
    <?php try { $mongodb = new Mongo(); $articleCollection = $mongodb->myblogsite->articles; } catch (MongoConnectionException $e) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required