Problems connecting to the Mysql database

3

I'm trying to create a system for college, however I'm having an error while trying to connect with Mysql, I'm using PHP and Xampp.

Error:

  

Fatal error: Call to undefined function mysqli_conect () in   C: \ xampp \ htdocs \ Courses \ Tests \ Connecting.php on line 2

I have tried some solutions that worked with others but they did not work for me:

Changes in PHP.ini:

  • extension_dir="C:\xampp\php\ext" - Conforms to what they report.
  • extension=php_mysql.dll and extension=php_mysqli.dll - Uncommented.
  • Apache restarted after the changes.

Does anyone have any idea what can be done?

Thank you in advance.

    
asked by anonymous 10.05.2015 / 07:49

1 answer

5

As the above user said mysqli_conect is poorly written, it writes mysqli_connect , hence you have the return: Fatal error: Call to undefined function mysqli_conect() in C:\xampp\htdocs\Cursos\Testes\conecta.php on line 2 that says that the function does not exist or is not defined. See if that helps.

<?php
 $link = mysqli_connect('localhost', 'Usuario_', 'Senha_', 'banco_de_dados_');
 if(mysqli_connect_errno()){
   die("Erro: ". mysqli_error());
 }
 echo 'Conexão bem sucedida';
 mysqli_close($link);
?>
    
10.05.2015 / 07:53