Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-updateZip

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  updateZip   Lines 252-286 (34 lines) file  utilsServerDB Geo.php   Last mod: Tue 2021-04-06 21:05:14

function updateZip $x )
        {
#-k     DB      geo
        
global $sq;     # web-t1.gwilt
        
        
$raw debug_backtrace();
        
$sq['f'] = $raw[0]['function'];
        
$sq['e'] = 0;
        
$sq['err'] = '';
        if (
$sq['init'] < 2) { abend 'Calling ' $sq['f'] . ' when DB not in RUN state.' ); }
        
        
$q 'UPDATE zipcode SET ';
        
$q .= 'city = "'$x['city']    . '",';
        
$q .= 'st = "'  $x['st']      . '",';
        
$q .= 'lat = "' $x['lat']     . '",';
        
$q .= 'lon = "' $x['lon']     . '",';
        
$q .= 'tz = "'  $x['tz']      . '",';
        
$q .= 'DST = "' $x['DST']     . '",';
        
$q .= 'cc = "'  $x['cc']      . '" ';
        
$q .= ' WHERE zip = "'  $x['zip'] . '"';

        
$q str_replace '""'" "$q );     # drop quoted null strings
        
$sq['q'] = $q;

        
$sq['dbin']++;
        if (!
mysqli_query $sq['conn'], $q ))
                {       
# fail
                
$err mysqli_error$sq['conn'] );
                
$sq['dbot']++;
                if (
strlen($err)) { $sq['err'] = $err$sq['e'] = 1; return $sq; }
                }
        
$sq['dbup']++;
        return 
$sq;
        }

?>