Error in data base connection in PHP

-1

I am learning php and when I try to connect to the database I get this error:

  

Warning: mysqli_connect (): php_network_getaddresses: getaddrinfo   failed: Unknown host. in C: \ xampp \ htdocs \ php2 \ Exercise   1 \ conexion.php on line 2

     

Warning: mysqli_connect (): (HY000 / 2002): php_network_getaddresses:   getaddrinfo failed: Unknown host. in   C: \ xampp \ htdocs \ php2 \ Exercise 1 \ connection.php on line 2

this is my code:

<?php
$link= mysqli_connect("localhots","root","","matriculas");
?>

can someone help me? thank you very much.

    
asked by lastcrow 17.11.2018 в 02:59
source

1 answer

0

The server host is called localhost, you wrote localhots.     $ link = mysqli_connect ("localhost", "root", "", "matriculas");

    
answered by 17.11.2018 в 03:04