id; $name = $data->name; $outfitchange = updateOutfit($user->id, $outfitid, $name); if ($outfitchange === true) { $outfitchange = "Outfit Updated"; } } else if ($deleteoutfit) { $outfitid = $data->id; $outfitchange = deleteOutfit($user->id, $outfitid); if ($outfitchange === true) { $outfitchange = "Outfit Deleted"; } } header('Content-Type: application/json'); echo json_encode(array("alert" => $outfitchange)); }