eMark
03-08-2005, 01:21 PM
Hi,
I am running this script on a daily basis updating 25,000 items and would like to know if the way I am doing it is the most effient way.
$row = 1;
$open_file = fopen("files/Item.tsv","r");
while (($data = fgetcsv($open_file, 1000, "\t")) != FALSE) {
$query = "UPDATE product SET Item='".$data[0]."' WHERE Product='".$data[1]."'";
$result = mysql_query($query) or die("Invalid query: " . mysql_error().__LINE__.__FILE__);
$row++;
}
fclose ($open_file);
Any suggestions for improvement would be appreciated.
I am running this script on a daily basis updating 25,000 items and would like to know if the way I am doing it is the most effient way.
$row = 1;
$open_file = fopen("files/Item.tsv","r");
while (($data = fgetcsv($open_file, 1000, "\t")) != FALSE) {
$query = "UPDATE product SET Item='".$data[0]."' WHERE Product='".$data[1]."'";
$result = mysql_query($query) or die("Invalid query: " . mysql_error().__LINE__.__FILE__);
$row++;
}
fclose ($open_file);
Any suggestions for improvement would be appreciated.