http://php.net/manual/ru/function.fgetcsv.php
<?php
$row = 1;
if (($handle = fopen("test.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num полей в строке $row: <br /></p>\n";
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";
}
}
fclose($handle);
}
?>
$row = 1;
$k = 0;
if (($handle = fopen($this->request->files['import83']['tmp_name'], "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num полей в строке $row: <br /></p>\n";
if (isset($data[3]) && isset($data[8])) { // ты уверен, что 3-8, а не 2-7 ?
$sku = (int)preg_replace("/\D/","", $data[3]);
$qty = (int)preg_replace("/\D/","", $data[8]);
$this->db->query("UPDATE " . DB_PREFIX . "product SET quantity = ". (int)$qty . "WHERE sku =" . $this->db->escape($sku));
$k++;
}
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";
}
}
fclose($handle);
}