Pete C
asked on
connect to mysql using php
I installed the latest versions of apache, php and mysql on windows 10. I am trying to connect to mysql for the first time within php and the code simply stops, i.e. there is no error message, and it will not proceed to the line below the following statement.
$connection = new mysqli('localhost','root', 'password' , '');
Do I need to start mysql after installing it, if so, how do I do that?
Thanks,
Pete
$connection = new mysqli('localhost','root',
Do I need to start mysql after installing it, if so, how do I do that?
Thanks,
Pete
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
To allow php to connect with mysql in windows, change the hosts file that is located within the below directory:
Windows\system32\drivers\e
uncomment the below line:
127.0.0.1 localhost (to do so, type note pad within the startpanel search bar, choose run as administrator, and then open the file).
Thanks again for any thoughts