This is a simple API written in PHP to access student database using the CRUD operations to view and manage.
CRUD is the acronym for CREATE, READ, UPDATE and DELETE
Download the MyDatabase.php file and upload it inside any folder using the file manager. Make sure you change the database information in the PHP file. You will have to enter your database name, username and password that you set while creating the database. Now from the phpMyAdmin create new table by the name students
with columns such as id
, name
, age
, grade
and save it. Now run the API request directly on your browser address bar or using any API testing tools like Postman or instantly access via ReqBin
https://example.com/MyDatabase.php?action=getAllStudents
https://example.com/MyDatabase.php?action=addUser&name=John&age=25
https://example.com/MyDatabase.php?action=editUser&id=1&name=Jane&age=30
https://example.com/MyDatabase.php?action=deleteUser&id=1
id | name | age | grade |
---|---|---|---|
1 | Sabith Pkc | 24 | 1st |
2 | Vishnu | 25 | 7th |
3 | George Mathew | 30 | 5th |