Error loading php page into online site

0

I did the whole site on my computer testing with xamp. But when I went online, there were some problems loading 3 similar bank access pages.

<?php 
require_once('db.class.php');

$objdb = new db();
$link = $objdb->conecta_mysql();

$sql =  "SELECT DISTINCT categoria FROM produtos ORDER BY categoria";
if($resultado = mysqli_query($link, $sql)){
    if($resultado->num_rows > 0){
        while($linha = mysqli_fetch_assoc($resultado)){
            $vetor[] = $linha;
        }
        echo json_encode($vetor);
    }else{
        echo json_encode('');
    }

}else{
    echo json_encode("errobanco");
}

? >

The following error appears in the browser:

Failed to load resource: net::ERR_EMPTY_RESPONSE crud/carregar_cat.php:1

NOTE: I'm using a free host to test.

    
asked by anonymous 23.06.2018 / 19:44

0 answers