process your php/mysql first, ie above your page content.
<html>
<head>
<title>hi</title>
</head>
<body>
<?php
your php is probably here.
?>
</body>
</html>
<?php
try putting it up here
?>
<html>
<head>
<title>hi</title>
</head>
<body>
</body>
</html>
putting the php above your page content should ensure that the mysql query has been processed prior to the loading of the rest of your page. this should make your on screen info more accurate.