Every project that uses PHP to connect to a database should absolutely use PDO and prepared statements. By now this is more than the suggested way of doing things, anything less than using PDO is a potential security hazard and very weak code.
This project provides a simple to understand, use and extend example template to use PHP’s PDO features, have an interface and mapper.
Everything you need is included in the code: CREATE, READ, UPDATE, DELETE.
Additionally, this project includes a frontend with AJAX functionality.
Code features database mapper, data model objects, ajax interface and the frontend itself.
The frontend allows for on-the-fly ajax editing of the data.
This project uses jquery which is included in the project.
Make sure your server is running PHP 5.4 or higher.
Make sure to replace the database credentials.
Use the included sql file to setup the database.
Click into any field to make it editable and change it on the fly, using ajax. Hit enter to commit changes.