Page 1 of 1

mysqli_connect (): (HY000 / 1049)

PostPosted: 20. March 2021 18:31
by Jannirod
Hello, when I open the local host on the web on XAMPP , the folder where the PHP web page is, I open it and the following code appears
Warning: mysqli_connect (): (HY000 / 1049): Unknown database 'school_system_2' in C: \ xampp \ htdocs \ test \ models \ Server.php on line 23

Fatal error: Uncaught TypeError: mysqli_error (): Argument # 1 ($ mysql) must be of type mysqli, bool given in C: \ xampp \ htdocs \ test \ models \ Server.php: 23 Stack trace: # 0 C: \ xampp \ htdocs \ test \ models \ Server.php (23): mysqli_error (false) # 1 C: \ xampp \ htdocs \ test \ models \ Login.php (12): Server -> __ construct () # 2 C: \ xampp \ htdocs \ test \ controllers \ index_controller.php (15): Login -> __ construct () # 3 C: \ xampp \ htdocs \ test \ Index.php (3): require_once ('C: \\ xampp \\ htdocs ... ') # 4 {main} thrown in C: \ xampp \ htdocs \ test \ models \ Server.php on line 23.

What do you recommend me to do? :|

Re: mysqli_connect (): (HY000 / 1049)

PostPosted: 20. March 2021 18:43
by Altrea
Hi,

The error message is pretty much self explaining. There is a file "C:\xampp\test\models\Server.php" which tries to connect to the database "school_system_2" which does not exist.
We cannot tell you what "C:\xampp\test\models\Server.php" is or what "school_system_2" is. Both are parts not shipped with XAMPP.