Connected to MySQL database but cannot print the data
You definitely have to check your query execution response, as clearly suggested by the mysqli::query documentation, by adding the following code fragment just after the query call.

if (!$result) {
    printf("Error: [%s] %s&lt;br/&gt;", $conn-&gt;errno, $conn-&gt;error);
}


Hope it helps.