Hello, I have the following code, it is displaying data from the database but not adding data into the database [closed]

I have tried the code but not working. The select statement is working fine but the UPDATE And INSERT statements are not making any changes in the database.
Even the DELETE query made is not working. There is also a javascript file that contains code which then connects to this file below.

<?php

    include("db_connect.php");
    // handle a GET
    // add the header line to specify that the content type is JSON
    header("Content-type: application/json");

    // determine the request type
    $verb = $_SERVER["REQUEST_METHOD"];

    if ($verb == "GET") {
        $arr = array();

        $rs = mysqli_query($link,"SELECT s.id, s.name, s.local_church_id as l_id, l.name as local_church_name, l.id as local_church_id from small_christian_community s, local_church l WHERE s.local_church_id = l.id ORDER BY l.name ASC");
        while($obj = mysqli_fetch_object($rs)) {
            $arr[] = $obj;
        }

        // add the header line to specify that the content type is JSON
        header("Content-type: application/json");

        echo "{"data":" .json_encode($arr). "}";
    }

    if ($verb == "PUT") {

            $request_vars = Array();
            parse_str(file_get_contents('php://input'), $request_vars );
            $name = mysql_real_escape_string($request_vars["name"]);
            $local_church_id = mysql_real_escape_string($request_vars["local_church_id"]);



            // INSERT COMMAND
            $insert_query = "INSERT INTO small_christian_community(name, local_church_id) VALUES ('".$name."','".$local_church_id."')";

          $rs = mysqli_query($link,$insert_query);

          if ($rs) {
            echo json_encode($rs);
          }
          else {
            header("HTTP/1.1 500 Internal Server Error");
            echo false;
          }
    }
    if ($verb == "POST") {
            $name = mysql_real_escape_string($_POST["name"]);
            $local_church_id = mysql_real_escape_string($_POST["local_church_id"]);
            $id = mysql_real_escape_string($_POST["id"]);

            $rs = mysqli_query($link,"UPDATE small_christian_community SET name = '" .$name ."',local_church_id = '" .$local_church_id ."' WHERE id = " .$id);

            if ($rs) {
                echo json_encode($rs);
            }
            else {
                header("HTTP/1.1 500 Internal Server Error");
                echo "Update failed for church: " .$id;
            }
    }

    if ($verb == "DELETE") {
        parse_str(file_get_contents('php://input'), $_DELETE);
        $id = mysql_real_escape_string($_DELETE["id"]);

        $rs = mysqli_query($link,"DELETE FROM small_christian_community WHERE id = " .$id);

        if ($rs) {
            echo true;
        }
        else {
            header("HTTP/1.1 500 Internal Server Error");
            echo false;
        }
    }

?>

Someone please help