Search Data with REST API in PHP
<?php $servername = "localhost" ; $username = "root" ; $password = "" ; $database = "test" ; //Create Connection $conn = new mysqli ( $servername , $username , $password , $database ); //Check Connection if ( $conn -> connect_error ) { die ( "Connection Failed: " . $conn -> connect_error ); } Above File is mysqli_conn.php which is included in below files. Below file is api-search.php File. <?php header ( "Content-Type: application/json" ); header ( "Access-Control-Allow-Origin: *" ); // $data = json_decode(file_get_contents("php://input"), true); // $search_value = $data["search"]; //Search through URL as shown below : $search_value = isset ( $_GET [ "search" ]) ? $_GET [ "search" ] : die (); include ( "mysqli_conn.php" ); $sql = " SELECT * FROM students WHERE student_name LIKE '%{ $search_value }%' " ; $result = $c...