0
Hello,
I’m having a problem with one part of the code:
function obterBD($nome){
// Conecatar banco de dados
if(!$conn = connectBD()){
return false;
}
// Incluir/Atualizar retorno no banco de dados
$arrayReturn = getnota($conn, $nome);
if(isset($arrayReturn['registros'])){
return $arrayReturn;
}
$arrayReturn = array_merge(getmatricula($conn, $nome), $arrayReturn);
$arrayReturn = array_merge(getnomecompleto($conn, $nome), $arrayReturn);
// Encerra conexão com banco
closeBD($conn);
return $arrayReturn;
}
The page is as follows:
Make a request on a webservice and take the data. It turns out that sometimes there is no "full name" and then error is shown:
Warning: array_merge(): Argument #1 is not an array in path on line 69
$arrayReturn = array_merge(getnomecompleto($conn, $nome), $arrayReturn); --> Essa é a linha 69.
And if I comment this line the error disappears. As I put so that if you can’t get the full name, write something like: "Not available" ?
In function
getnomecompleto
return an empty array or an array with the empty position.– Don't Panic
@Everson, an empty array.
– Marcelo