Fatal error: Uncaught mysqli_sql_exception: Database 'bsmn' is unknown
P粉343408929
P粉343408929 2023-10-24 18:44:33
0
1
743

I have imported the database into my php admin but the problem still exists:

Fatal error: Uncaught mysqli_sql_Exception: Unknown database 'bsmn' in C:xampphtdocsbsmnconnection.php:8 Stack trace: #0 C:xampphtdocsbsmnconnection.php(8): mysqli_connect('localhost', 'root', '', 'bsmn') #1 C:xampphtdocsbsmnindex.php(4): include('C:xampphtdocs...') # 2 {main} throws in C:xampphtdocsbsmnconnection.php on line 8 This is line 8 > if(!$con = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname)) This file connection.php

<?php

$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "bsmn";
if(!$con = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname))
{

    die("failed to connect!");
}

P粉343408929
P粉343408929

reply all(1)
P粉127901279

means you don't have a database named bsmn, if you use phpmyadmin find the database on the left and make sure it matches the database in your code above.

$dbname = "bsmn"; //This is looking for a database of the same name

Navigate to PhpMyadmin and check the left side as shown in the image below, you will see which databases you can connect to, if "bsmn" is not in the list, it does not exist.

Maybe you are looking for a table called "bsmn" but this will be in the database and you will need that database name.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template