the while loop is this creates so many of them it crashes my browser what is wrong with the code?
<?php
$template = "<a name=\"topic-{ID}\"></a><h2><a href=\"#\">{TITLE}</a></h2><p class=\"post-by\">{CONTENT}</p><p class=\"post-footer align-left\"><a href=\"index.php\" class=\"readmore\">Posted {DATE_POSTED}</a><br /></p>";
$sql = "SELECT * FROM `news` LIMIT 3";
$result = @mysqli_query($cxn, $sql) or print("No Posts Found.");
while($row = mysqli_num_rows($result)){
$temp = str_replace("{TITLE}", $row['title'], $template);
$temp = str_replace("{DATE_POSTED}", $row['datePosted'], $temp);
$temp = str_replace("{ID}", $row['id'], $temp);
$temp = str_replace("{CONTENT}", $row['content'], $temp);
echo $temp;
}
?>