Posts

BUILDING A SIMPLE REST API FOR INVENTORY MANAGEMENT

Image
  INTRODUCTION : Representational State Transfer (REST) is an architectural style that defines a set of constraints to be used for creating web services. REST API is a way of accessing web services in a simple and flexible way without having any processing. There are numerous types of APIs, making it difficult for new developers to differentiate between each kind. In particular, Representational State Transfer (REST) is a software architectural style that developers apply to web APIs. REST APIs provide simple, uniform interfaces because they can be used to make data, content, algorithms, media, and other digital resources available through web URLs. The method is the type of request you send to the server. The four main resource methods that are associated with REST APIs are: GET:  This method allows for the server to find the data you requested and sends it back to you. PUT:  If you perform the ‘PUT’ request, then the server will update an entry in the database. POST:  This method per

Demonstration of CRUD operation with PDO database connection

Image
 Databases are everywhere and there is no practical PHP application that could exist without a database. From the very beginning, PHP offers several ways of interfacing with all popular DBMS. For instance, two popular ways of interfacing with MYSQL database are  mysql  and  mysqli. Over years, databases have come a long way and now several different vendors offer popular DBMS that power modern PHP apps. To standardize and streamline development practices, PHP introduced PHP Data Objects (PDO) in PHP 5.1. These objects are used to setup PDO database connections. PDO is a database access layer which provides a fast and consistent interface for accessing and managing databases in PHP applications.  Every DBMS has specific PDO driver(s) that must be installed when you are using PDO in PHP applications.   Follow the given steps : STEP 1 : Establish a connection with Database     Create a new file name   as connection . php in project directory /var/www/html   now for establishing connection