Mysql database connection issues

Asked

Viewed 1,183 times

3

I am trying to create a system for college, but I have an error when trying to connect with Mysql, I am using PHP and Xampp.

Error:

Fatal error: Call to Undefined Function mysqli_conect() in C: xampp htdocs Testing Courses connects.php on line 2

I’ve tried some solutions that worked with others but didn’t work with me:

Changes to PHP.ini:

  • extension_dir="C:\xampp\php\ext" - You agree with what they say.
  • extension=php_mysql.dll and extension=php_mysqli.dll - Uncoloured.
  • Apache reset after the amendments.

Does anyone have any idea what can be done?

Thank you in advance.

  • You did not set in Function mysqli_conect() the host for it to connect.

  • 2

    You missed when typing the function. It’s not mysqli_conect, and yes mysqli_connect. You missed an "n"!

  • Really, the mistake was this same, thank you very much for the help.

1 answer

5


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

<?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);
?>
  • Really, the mistake was this same, thank you very much for the help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.