Example I have a code select data in sever
$sql = "SELECT * FROM ..."
$result = mysqli_query($conn,$sql)
$row = array()
if($result){
while($r = mysqli_fetch_assoc($result)) {
$rows[] = $r;
}
I often use ajax to show data in html . But I see some people render in html by php like
index.html
<div> <?php echo $row ?> </div>
I think it not good but i dont know why . Please explain for me. Many thanks