<?php
/* This will upload number of pictures and videos loaded by the user to user table for control purposes. */

include_once('../init.php');

$users = $osDB->getAll('select id, zip, country from ! where zip is not null', array(USER_TABLE));

foreach ($users as $usr) {
	$ziprec = $osDB->getRow('select * from ! where countrycode=? and code=? limit 1',array(ZIPCODES_TABLE, $usr['country'], $usr['zip']) );
	
	$osDB->query('update ! set zip_latitude=?, zip_longitude=? where id=?', array(USER_TABLE, $ziprec['latitude'], $ziprec['longitude'], $usr['id']));

}

echo("USER TABLE Update is over");

?>