Advertisement
Guest User

Inserção de Imagens

a guest
Sep 8th, 2014
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. while($codigo = mysql_fetch_array($pegacodigos)){
  2.        
  3.         $array  = array(
  4.                 'key' => '',
  5.                 'module' => 'imoveis',
  6.                 'method' => 'busca_fotos',
  7.                 'field' => array (
  8.                         'CODIGO'        => 'Codigo',
  9.                         'IMAGEM_G'      => 'Foto',
  10.                         'IMAGEM_P'      => 'Thumbnail',
  11.                 ),
  12.                 'filter'                => array (
  13.                         'CODIGO'        => $codigo['CODIGO']
  14.                 ),
  15.                 'limit'                 => '0, 1000'
  16.                                
  17.         );
  18.  
  19.         $client = new SoapClient(null, array (
  20.                 'uri' => 'http://soap.imo.bi/',
  21.                 'location' => 'http://soap.imo.bi/soap.dll',
  22.                 'trace' => 'trace'
  23.         ));
  24.  
  25.         $res = $client->get($array);
  26.                
  27.         for($j = 0; $j<count($res)-1; $j++){
  28.  
  29.                 $c = $res[$j]['Codigo'];      
  30.                 $d = $res[$j]['Foto'];
  31.                 $e = $res[$j]['Thumbnail'];    
  32.  
  33.                 $ins = mysql_query("INSERT INTO imagens VALUES ('".$codigo['CODIGO']."', '$c', '$d', '$e')")
  34.                 or die (mysql_error());
  35.  
  36.         }
  37.                
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement