Using PDO OOP in PHP here I built an REST API
In many applications, REST API is a need because this is the lightest way to create, read, update or delete information between different applications over the internet or HTTP protocol. This information is presented to the user in an instant especially if you use JavaScript to render the data on a webpage.
REST API can be used by any application that can connect to the internet. If data from an application can be created, read, updated or deleted using another application, it usually means a REST API is used.
--> Setup the database --> Create categories table --> Dump data for categories table --> Products table --> Dump data for products table --> Connect to database
--> Product object --> Create file to read products --> Connect to database and products table --> Read products from the database --> Add Product "read()" method --> Tell the user no products found --> Output
--> Create create.php file --> Product create() method --> Output
--> Create read_one.php file --> Product readOne() method --> Output
--> Create “update.php” file --> Product update() method --> Output
--> Create “delete.php” file --> Product delete() method --> Output
--> Create "search.php" file --> Create "search()" method --> Output
--> Category object --> Create "read.php" file --> Category "read()" method --> Output