I have just downloaded the wamp server. I want to establish a connection to MySQL database with PHP and I'm using the root user, localhost and the name of my database. My code seems to be correct but when I run it on wamp, I get the following error: Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\cone.php on line 8 and Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known.
Also, the error message that I haven't been connected to the database(from my if statement) is displayed.
Does this mean that I have to do some extra configuration on the server?
Here is my code:
<?php
$dbcon = mysqli_connect('root','', 'localhost', 'people');
`if(!$dbcon)`
`{`
`die('error connecting to database');`
`}`
`echo "success";`
?>
Thank you in advance