let user_zapros = JSON.stringify({
hudohnik: 1
});
let request = new XMLHttpRequest();
request.open("POST", "../Site_requests/artistOne.php", true);
request.setRequestHeader("Content-Type", "multipart/form-data");
request.addEventListener("load", function() {
console.dir(request.response)
})
request.send(user_zapros);
<?php
include 'bd.php';
$id = $_POST["hudohnik"];
if($id) {
$request = $mysql->query("SELECT * FROM `artist` WHERE `artist_id` = '$id'");
$obj = [];
while($i = $request->fetch_assoc()) {
array_push($obj, $i);
}
echo json_encode($obj);
}
else {
echo "false";
}
?>
let user_zapros = JSON.stringify({
hudohnik: 1
});
let request = new XMLHttpRequest();
request.open("POST", "../Site_requests/artistOne.php", true);
request.setRequestHeader("Content-Type", "multipart/form-data");
request.addEventListener("load", function() {
console.dir(request.response)
})
request.send(user_zapros);
<?php
include 'bd.php';
$id = $_POST["hudohnik"];
if($id) {
$request = $mysql->query("SELECT * FROM `artist` WHERE `artist_id` = '$id'");
$obj = [];
while($i = $request->fetch_assoc()) {
array_push($obj, $i);
}
echo json_encode($obj);
}
else {
echo "false";
}
?>