Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ArnabDutta246/php-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-api ( new version)

Using PDO OOP in PHP here I built an REST API

Why do we need 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.

Where REST API is used?

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.

File structure

--> Setup the database --> Create categories table --> Dump data for categories table --> Products table --> Dump data for products table --> Connect to database

Read products

--> 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 Product

--> Create create.php file --> Product create() method --> Output

Read One Product

--> Create read_one.php file --> Product readOne() method --> Output

Update product

--> Create “update.php” file --> Product update() method --> Output

Delete Product

--> Create “delete.php” file --> Product delete() method --> Output

Search Products

--> Create "search.php" file --> Create "search()" method --> Output

Read Categories

--> Category object --> Create "read.php" file --> Category "read()" method --> Output

About

Using PDO OOP in PHP here I built an REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages