I'm new to PHP, MySQL dev. I'm trying to make a simple webapp, was following a tutorial. This is the PHP script it showed to grab info about the 'detectives' table.
<?php
$mysqli = new mysqli('localhost', 'root', 'root!', 'intrepid_detectives');
$result = $mysqli->query("SELECT * FROM detectives");
echo "<pre>";
print_r($result);
But when I open this page on my browser by going to localhost/index.php
, it gives me this error:
The website encountered an error while retrieving
http://localhost/index.php
. It may be down for maintenance or configured incorrectly.
I asked a guy, he said the problem is with mysqli
, so I searched on SO, and followed this post, but it still gives the same error.