JS-Кнопка выгрузки из Бызы Данных.

-------------------------
'use strict';

kn1.onclick = async () => {
let response = await fetch('json.php', {
method: 'POST',
});

let data = await response.json();

alert(data.name3);
}
---------------------

$mysqli = new mysqli("localhost", "", "", "");

print json_encode($mysqli->query("SELECT * FROM test5 where id=2") -> fetch_assoc());