MongoDB and PHP: An Intermediate Tutorial

MongoDB is an exciting and (relatively) new database technology that’s gaining popularity among developers. And odds are you’re here for one of two reasons:

  1. You want to practice using MongoDB in a PHP environment
  2. You got lost on the Internet and don’t know why you’re here

If you’re here for reason number 1 then you’re in luck because I happen to have an intermediate level tutorial all prepared that will take you step by step through the process of designing and coding a MongoDB web application.

Part 1: Introduction

Part 2: Project Design

Part 3: Getting Familiar With MongoDB

Part 4: Reading The Database With PHP

Part 5: Sorting Data

Part 6: Finding One Unique Document

Part 6.5: Fixing itemView.php

Part 7: User Friendly Data Input

Part 8: Deleting Items

Part 9: Final Feature Is Search

Download Complete Tutorial Code

I strongly suggest following the tutorials and writing your own code as you go. But I’ve also included a complete copy of the project’s code if you need a reference or are having trouble getting a particular bit of code to work. As long as you have properly configured your server and PHP environment to work with MongoDB you should be able to just drop these files into a server directory and watch it work.