<?php require_once("../../classes/DBConnection.php"); $DB = new DBConnection();

echo "<br />Started...";
$res = $DB->execute("select id, prefixfam, fueltype, capacity, seats from prefixesload where id>'46289' order by id ASC");

if(!is_null($res)){
	$res = $res[0];
	while($W = $DB->nextRow($res)){
		$id = $W['id'];
		$prefixfam = $W['prefixfam'];
		$fueltype = $W['fueltype'];
		$capacity = $W['capacity'];
		$seats = $W['seats'];

		//NOW GO
		saveToRow($id, $prefixfam, $fueltype, $capacity, $seats);
	}
	echo "<br />ENDED<hr />";
}else{ "<span style='color:#F00'>Error in Commencement</span><br />"; }


function saveToRow($id, $prefixfam, $fueltype, $capacity, $seats){
	global $DB;

	if($DB->simpleQuery("update us_vinprefixes set nhtsa_fueltype='{$fueltype}', nhtsa_capacity='{$capacity}', nhtsa_seats='{$seats}' where prefixfam ='{$prefixfam}'")){

		echo "<br />Done at #{$id} {$vin}";
	}else{
		echo "<br /><span style='color:#F00'>Error at #{$id} {$vin}</span>";
	}
}
?>