I would like a PHP script to read the contents from a CSV file in the following format
id, sku
1,104101
2,105213
there are a total of 1486
fgetcsv can be used to parse CSV files. mysql_query method could be used to perform MySQL queries.
The complete code is as follows:
\n";
while (($data=fgetcsv($fin,1000,","))!==FALSE) {
$query = "UPDATE catalog_product_entity SET sku='$data[1]' WHERE entity_id='$data[0]'";
mysql_query($query);
echo "Record updated
\n";
}
fclose($fin);
mysql_close();
?>