Hi,
By switching from Wampserver 2 to Wampserver 3.1.0, you have changed PHP and MySQL versions.
Check that your code is compatible with the new versions.
Your problem has absolutely nothing to do with Wampserver.
This forum is not intended to debug users PHP scripts or MySQL requests.
---------------------------------------------------------------
Documentation Apache -
Documentation PHP -
Documentation MySQL -
Wampserver install files & addons