Post returns null values Slim4

So when running through postman and inserting values everything returns null and nothing is added to the database.

$app->post('/api/user_info/register/{name}/{email}/{password}', function($request, $response, $args){
    //Connect to db
    require_once('dbconnect.php');
    //Get the user inputed name, email, password
    $name = $request->getAttribute('name');
    $email = $request->getAttribute('email');
    $password = $request->getAttribute('password');

    $query = "insert into user_info (name, email, password) values (?, ?, ?)";
    $stmt = $mysqli->prepare($query);
    $stmt->bind_param("sss", $name, $email, $password);
    $newResponse = $response->withJson($stmt);
        return $newResponse;
});


Read more here: https://stackoverflow.com/questions/67376164/post-returns-null-values-slim4

Content Attribution

This content was originally published by Hxzzl at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: