hello
// $obj->we
// $obj->your
// $obj = json_decode($_POST['x']);
// print_r($obj);
// print_r($obj->your);
// print($obj->your->first);
// print_r($obj->mine);
// http_response_code(400);
// echo json_encode($_POST);
// echo json_encode(array("error" => "No title given."));
require_once 'processes/config.php';
require_once 'processes/dbh.inc.php';
// $result = mysqli_num_rows(mysqli_query($connection, "select * from question where id = 3adsfasdf"));
// var_dump($_POST);
// echo "
";
$result = mysqli_real_escape_string($connection, trim($_POST["id"]));
// $_POST["id"] devuelve null si no está definido
// trim() devuelve "" si el input es null / "" / false
// mysqli_real_escape_string() devuelve "" si no el input es null / "" / false
// echo "This is result: $result
";
if($result === "") {
echo "Result is empty string";
} else {
echo "Result isn't empty string";
}
?>