Build REST CRUD APIs with PHP and MySQL
Hello everyone. today we will learn how to develop REST-style CRUD APIs with PHP and MySQL. After completing this tutorial what we will build? We will build REST API CRUD features: GET - Fetch all User : /php-mysql-crud-api/read.php GET - Get User by ID : /php-mysql-crud-api/single_user.php/?id=172 POST - Create User : /php-mysql-crud-api/create.php PUT - Edit User Details : /php-mysql-crud-api/update.php DELETE - Delete User : /php-mysql-crud-api/delete.php/?id=172 Project Directory: Setting Up Database: Create Database "user_db" and create table "user" -- -- Database: `user_db` -- -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` bigint ( 20 ) UNSIGNED NOT NULL , `first_name` varchar ( 50 ) NOT NULL , `last_name` varchar ( 50 ) NOT NULL , `email_id` varchar ( 50 ) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ALTER TABLE `user` ADD