<?php if (!empty($_POST['id']) and is_numeric($_POST['id'])) { $id = $_POST['id']; require_once '../classes/crud.php'; $dbObject = new crud(); echo json_encode($dbObject->getOneRow('organizations', $id), JSON_FORCE_OBJECT); }