Connection to db using php in localhost
问题 Even if I have used LAMPP many times, this time something goes wrong. When I visit the browser(chrome) nothing echos. Here is my code: index.php <?php error_reporting(E_ALL); /*after edit*/ $link = mysqli_connect('localhost', 'root', 'root', 'db'); if (!$link) { die('Could not connect: ' . mysqli_error()); } echo 'Connected successfully'; mysqli_close($link); ?> Do I miss something? The output is nothing. By the way i write my files in var/www/html/my_pages and i call it this way: localhost