Q:

Echoing Fetch_Assoc Fails

I'm really stuck on something here, I honestly cannot see anything wrong here myself and I've done something like this several times throughout my site.
I want my home page to update with up to the three most recent news updates. I have my table all setup with an entry for testing as well. This is my php code to display the three most recent posts:
    <?php
$sql = mysqli_query($link, "SELECT * FROM news ORDER BY PostCreated ASC LIMIT 3");

if($sql)
    {
        while($row = mysqli_fetch_assoc($sql))
            {
                echo $row['PostContent'];
            }
        else
            {
                echo "Cannot fetch current news update. Error: " . mysqli_error($link);
            }
    }
else
    {
        echo "Cannot fetch current news update. Error: " . mysqli_error($link);
    }
?>

So as you can see it grabs the three most recents and I have proved this by placing echo mysqli_num_rows($sql); just before the while loop. This returns 1 which is correct as there is only one entry.
The problem comes when I am attempting to echo $row['PostContent']; The entire page goes blank, if I take the while loop out of the equation, it will display the rest of the page, but it is almost as if me using echo $row['PostContent']; stops the rest of the page loading at all?
Any help would be appreciated, and I am so sorry if this is a really silly mistake on my part that ends up wasting your time guys. Thank you!

A:

The probable problems here are:

You have used an else block after the while loop.
You have error_reporting turned off.

These explain the page going blank when while is present and the page executing the rest when it is taken away.

