Quote tags don't use preformatted text elements. Using the [php][/php] or [code][/code] will retain the formatting. For which yours is very good.
So let me see if I understand this correctly. You only need to keep in the file the top five entries is that correct? If I add another entry that is < any of the top 5, it is just abandoned, and if I insert an entry > any of the top 5 than it shifts the lowest out and inserts the new one?
Are you allowed to use in-memory variable allocations for the class? The easiest way to do this involves an array or collection, for which you can sort and makes it easy to tell if an item can fit in it. A *slight* pain when it comes to shifting an array such as removing the lowest score and inserting a new one in the middle which pushes everything else down, but that can be worked around by simply overwriting the lowest and then sorting it again. If you're familiar with collections, a LinkedList is the one for this.
Operation wise for an application this small I'd load from a file during an initialization command. Keep what I can in memory for usage, then on quit I'd save it back in.
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php