I transfer data from DB Ajax to the Html page
var auto_refresh = setInterval( function(){ $.ajax({ url: "test.php" , type:'GET', //dataType: "json", cache: false, success:function(data){ $('#olm').html(data); console.log(data); } }); }, 15000); Php
$sql = "SELECT * FROM `work`"; $result = $mysqli->query($sql); // В цикле перебираем все записи таблицы и выводим их while ($row = $result->fetch_assoc()) { echo 'TITLE: '.$row['work']."<br/>"; echo 'SOCIAL: '.$row['title']."<br/>"; echo 'TEXT: '.$row['text']."<br/>"; echo 'TIME: '.$row['time']."<br/>"; } In ol ol ID, everything is displayed in one block, Actually the question: In reality, it’s all scattered across different IDs, eg echo 'TITLE: '.$row['work']."<br/>"; Write to #olm, and the second line echo 'SOCIAL: '.$row['title']."<br/>"; let's say id olm2? Thank.