head.php
824 Bytes
<?php
set_time_limit(0);
$_SERVER['DOCUMENT_ROOT'] = realpath(dirname(__FILE__)."/..");
require($_SERVER['DOCUMENT_ROOT'] . "/libs/setup.php");
$setup = new setup();
if (($handle = fopen("dk.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
if(strlen($data[0])>0){
//echo $data[0] . "<br />\n";
print $data[0] . ' - ' . $product_id = $setup->db->getOne("select product_id from catalogs_modifications where code=?",array($data[0]));
print'<br />';
if($product_id){
$fields_values = array('art'=>$data[1]);
print_r($fields_values);
$r = $setup->db->autoExecute("catalogs_products",$fields_values,DB_AUTOQUERY_UPDATE,"id='".$product_id."'");
if (PEAR::isError($r)) die($r->getMessage());
}
}
}
fclose($handle);
}
?>