im trying to create login system for my school project, but I run into a problem. When I'm trying to connect to database it always throw error:
Warning: mysqli::__construct(): (HY000/1049): Unknown database 'userverification'
It will pass only when I use databases which were created with installation of phpMyAdmin.
Code Im using for connecting is:
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'userverification');
$conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if ($conn->connect_error) {
die('Database error: . $conn->connect_error');
}
?>