This Weird Error With MySQL and PHP

Looking up the error message, a connection issue cannot be thrown out as it occurs when prepare returns false.

Check if there’s a possibility of any of the issues here affecting the connection:

Going on a hunch since you’ve transferred from localhost, I’m suspecting this: