🖐 Hi there, this is a simple REST API built in PHP without using any frameworks. This is built for the folks who are just getting started with APIs. As we all know that first working on core PHP gains a lot of knowledge on API, rather than jumping directly and relying on frameworks. So, I've built this simple PHP API that contains all CRUD operations. As an example, I've taken a student database with just name, address, and age as its table columns and have performed CRUD operations on it using APIs. Feel free to use this code and work around it. Hope you got the insights!
/api folder contains all PHP files for the CRUD operations
/config folder contains Mysql database configurations
/db folder contains database(.sql) file
/models folder contains a single Student.php for database logic
-
Well, first clone or download this repo.
-
Create a database and import db/studentdb.sql file in your database.
-
Change database configurations in config/Database.php file.
-
Check your endpoints.
http://localhost/php_rest_api_without_framework/api/get.php
http://localhost/php_rest_api_without_framework/api/get_one.php
http://localhost/php_rest_api_without_framework/api/post.php
http://localhost/php_rest_api_without_framework/api/put.php
http://localhost/php_rest_api_without_framework/api/delete.php
Please give me a star⭐ to this repo, I'll be happy😊.