Warning: mysqli_connect(): (HY000/2002): Connection refused in /storage/ssd3/666/4497666/public_html/conecta.php on line 2
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /storage/ssd3/666/4497666/public_html/banco-categoria.php on line 5
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /storage/ssd3/666/4497666/public_html/banco-categoria.php on line 6
<?php
$conexao = mysqli_connect("teste-php-e-mysql.000webhostapp.com", "id4497666_umberto", "jkzp0981", "id4497666_70909loja");
?> (conecta.php)
<?php
function listaCategoria($conexao){
$categorias = array();
$query = "select * from categorias";
$resultado = mysqli_query($conexao, $query);
while ($categoria = mysqli_fetch_assoc($resultado)){
array_push($categorias, $categoria);
}
return $categorias;
} (banco-cagoria.php)