I don't know why the text iis showing like that. Most of the time, when I get weird characters is due to a bad configuration (as an example, the charset in the database is different from the charset I use for the page)
The message "got packets out of order" normally means that MySQL is not receiving the packets in the right other. Since you're simply extracting information from the server, I can't think why this is the case.
I don't remember the book, I've read it a few years ago but to get the information about today's date... you only need PHP and you're having a MySQL error... are you trying to connect to the database when you're not extracting information from it?