$num_rows = mysqli_num_rows($result); // Подсчитали кол-во строк
echo $num_rows; // Вывели на экран
<script>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
jsonObject = JSON.parse(this.responseText);
let html = ''
for (let key in jsonObject.records) {
html += '<p>'
html += 'Имя:' + jsonObject.records[key].name
html += '</p>
}
document.getElementById('output').innerHTML = html;
}
};
xhttp.open("GET", "/api.php/records/users", true);
xhttp.send();
</script>
$posts = R::findAll('posts', 'module_id');
$find_ratings = R::findAll('rating');