hin Posted February 25, 2021 Share Posted February 25, 2021 Error message"" Warning: mysqli::__construct(): (HY000/1049): Unknown database 'app' in C:\xampp\htdocs\webapp\connection.php on line 2 Unable to connect to database [Unknown database 'app'] "" There are error message displayed when I go on to the website and it happens to all pages (PHP files). Below is the code on connection.php file" <?php $db = new mysqli('localhost', 'root', '', 'app'); ini_set ('display_errors', 'Off'); ?> "" Does anyone konw what is happening and how to fix this? many thanks Quote Link to comment https://forums.phpfreaks.com/topic/312216-can-not-access-to-the-website-and-no-content-displayed/ Share on other sites More sharing options...
Solution requinix Posted February 26, 2021 Solution Share Posted February 26, 2021 14 minutes ago, hin said: Does anyone konw what is happening The error message seems to rather clearly indicate that there is no "app" database. Have you tried looking into that? Quote Link to comment https://forums.phpfreaks.com/topic/312216-can-not-access-to-the-website-and-no-content-displayed/#findComment-1584775 Share on other sites More sharing options...
hin Posted February 26, 2021 Author Share Posted February 26, 2021 I have deleted the database and recreated it then imported the sql file again. Now it worked. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/312216-can-not-access-to-the-website-and-no-content-displayed/#findComment-1584783 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.