In Feburary 2016 12,
Launch a plain text editor, such as the Notepad, and create a new file.
Enter the script to connect PHP to a MySQL database by passing the hostname, username and password. For example, type:<?php
mysqli_connect('localhost', 'username', 'password') or die('Connection failed! ' . mysqli_error());
echo 'Connection successful!';
?>
Save the file as 'connect.php' and place it in the 'htdocs' directory for your WAMP implementation.
Test the connection by opening
connect.php in a Web browser and confirm that the connection was successful.
In Feburary 2016 12,