require("setup_do_banco.php");
$colunas = $pdo->prepare("SELECT * FROM origem WHERE ativado = 1");
$colunas->execute();
while ( $coluna = $colunas->fetchAll(PDO::FETCH_ASSOC) ) { $array_banco = $coluna; }
foreach($array_banco as $item){
$fields[] = sprintf("'%s' => '%s'", $item['field'], $item['description']);
}
$array = array (
'key' => '8b0dc65f996f98fd178a9defd0efa077',
'module' => 'imoveis',
'method' => 'busca_imoveis',
'field' => $fields
);
$client = new SoapClient(null, array (
'uri' => 'http://soap.imo.bi/',
'location' =>
'http://soap.imo.bi/soap.dll',
'trace' => 'trace'
)
);
Update 1
I think the code below is more correct, right?
require("setup_do_banco.php");
$colunas = $pdo->prepare("SELECT * FROM origem WHERE ativado = 1");
$colunas->execute();
$array_banco = $colunas->fetchAll(PDO::FETCH_ASSOC);
foreach($array_banco as $item){
###############################################
$fields[$item['field']] = $item['description'];
}
$array = array (
'key' => '8b0dc65f996f98fd178a9defd0efa077',
'module' => 'imoveis',
'method' => 'busca_imoveis',
'field' => $fields
);
$client = new SoapClient(null, array (
'uri' => 'http://soap.imo.bi/',
'location' =>
'http://soap.imo.bi/soap.dll',
'trace' => 'trace'
)
);