It's odd...... on mine, I found I couldn't get this to work unless I commented-out the last line. When I put my forum database name in there, it stopped working. The only problem I've found is that the Max Online in the ShortStats Pal (which is below the PhotoPost Pal along with other Pal boxes) doesn't convert the Unix time into normal time. Or at least I think that's the only problem.
I also tried adding above the last line:
mysql_connect ('localhost', 'name-of-my-database', 'password');
...and that worked just the same as when the last line is commented-out.