I installed WAMP server few hours ago into my Windows 10 64-bit computer. I used phymyadmin to create a database named 'testdb' and tried to connect to it with a php file. I am sure that I created the database, but it returns this error:
"Warning: mysqli_connect(): (HY000/1049): Unknown database 'testdb' in C:\wamp64\www\projects\index.php on line 7"
Here is the php file.
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_NAME', 'testdb');
$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
?>
My problem is kind of similar (but not exactly same) to the following question.:
Database is created but return error as unknown database
(However in that case, the database was not created by the original poster. In this case, I am pretty sure I have created the database.)