⊗ppSpAiCO 49 of 83 menu

API for CRUD Operations in PHP

Often, an API is created for CRUD operations. Let's outline an example of such an API.

Read All

Let the following URL return all records from the database:

GET http://api.loc/index.php?action=all

Read One

Let the following URL return one record from the database by its id:

GET http://api.loc/index.php?action=get&id=1

Delete

Let the following URL delete one record from the database by its id:

GET http://api.loc/index.php?action=del&id=1

Update

Let the following URL accept new data for a database record via the POST method and update that record by its id:

POST http://api.loc/index.php?action=edit&id=1

Implement the described API.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline