php - Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. Yet I clearly have to host there -


i have site written in php i'm creating. i'm having issue when connect database. when load page, top:

warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed:     no such host known. in c:\program files\apache software   foundation\apache2.2\htdocs\socialtest\inc\connect.inc.php on line 7  warning: mysqli_connect(): (hy000/2002): php_network_getaddresses: getaddrinfo failed: no such host known. in c:\program files\apache   software foundation\apache2.2\htdocs\socialtest\inc\connect.inc.php on line 7 

this connect.inc.php. file establishes connect mysql database:

$dbc = mysqli_connect('user','password','server','database'); #or die('captian, have failed' . #     mysqli_connect_error()); ?> 

the server name 'localhost' , never had problem until recently.

please let me know how can solve issue i've tried can think of , i'm out of options.

i'm using apache2.2, php .5.6.9 , mysql56 on windows vista.

thanks!

as "mario" said, mysqli_connect syntax wrong.

http://php.net/manual/fr/mysqli.construct.php

the right syntax example :

mysqli_connect('localhost', 'my_user', 'my_password', 'my_db'); 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -