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

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  addZip   Lines 167-199 (32 lines) file  utilsServerDB Geo.php   Last mod: Tue 2021-04-06 21:05:14

function addZip $x )
        {
#-k     DB      geo
        
global $sq;
        
        
$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 'INSERT INTO zipcode ( zip,city,st,cc,lat,lon,tz,DST ) VALUES ("';
        
$q .= $x['zip'] . '","';
        
$q .= $x['city']. '","';
        
$q .= $x['st']  . '","';
        
$q .= $x['cc']  . '","';
        
$q .= $x['lat'] . '","';
        
$q .= $x['lon'] . '","';
        
$q .= $x['tz']  . '","';
        
$q .= $x['DST'] . '") ';

        
$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'] = mysqli_errno $sq['conn'] ); return $sq; }
                }
        
$sq['dbup']++;
        return 
$sq;
        }
?>