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
    //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:

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: