Hi,
As you use two MySQL, you must use port number in the mysqli_connect() function.
Note 1 : use 127.0.0.1 instead of localhost.
Note 2 : You should have change the port by MySQL option available in Wampmanager tools. By not doing so, the MySQL port numbers are not changed in the Wampmanager configuration file.
---------------------------------------------------------------
Documentation Apache -
Documentation PHP -
Documentation MySQL -
Wampserver install files & addons