After 3 days trying to solve this problem, I found the answer that works for me.
I replaced php_mysql.dll and php_mysqli.dll with the ones that come with the php install when you specify to add mysql and mysqli extensions. Restarted WAMP and it works.
Forum:
WampServer English