添加特定的MySQL代码后,网页会停止加载

Here is the code I am talking about

<?php
$query = $mysqli->query("SELECT * FROM stories LIMIT 0, 10");
while($rows = mysqli_num_rows($query)) 
{
     $title = $rows['TITLE'];
     $writer = $rows['WRITER'];
     $content = $rows['CONTENT'];
     echo '<br/><br/>'.$title.'<br/><br/>';
}
?>

When I add this code inside the body of my webpage it stops loading, the loading circle just goes on. I am connecting to database properly because other pages are working fine. What is going on here.

you have an infinite loop.

$rows = mysqli_num_rows($query)

always returns more than 1 and therefor your while is always true.

$rows = mysqli_num_rows($query) is an infinite loop. This condition will always evaluate to true.

You should modify your code to read $rows = mysqli_fetch_row($query)