I'm trying to make an API .
Here is my code:
require('conexao/conexao.php');
$jsonObj= array();
$query="SELECT * FROM filmes";
$sql = mysql_query($query)or die(mysql_error());
while($data = mysql_fetch_assoc($sql))
{
$row[] = $data;
header("Content-type:application/json");
array_push($jsonObj,$row);
}
I'm trying to get the data from the API with the code below, but it does not return anything:
$url = "http://fimhd.com.br/api.php";
$captura = file_get_contents($url);
$json = json_decode($captura);
var_dump($json);