Split this one out into its own topic.
How is your PHP installed? Is your bot using the correct php.ini and is the php.ini pointing to the 5.3.1 versions of the libraries? Does your MySQL server accept piped connections (iirc localhost => piped connection on Windows, but i could be mistaken)