I used this code in php version 5, but after I switched to php 7, this error appeared.
Fatal error: Uncaught fetch_array () on array
$selec = $mysqli->query("SELECT cpf_cnpj, isento, ... ");
$exec = $selec->fetch_assoc();
while($campos = $exec->fetch_array()) {
extract($campos);
$Array = Array();
$Array[] = Array(
"cpf_cnpj" => "$cpf_cnpj",
"isento" => "$isento",
);
$json_encode = json_encode($Array);
echo $json_encode;
}
What am I doing wrong?
Thank you.