PDA

View Full Version : Is this the best way to do this?


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.

scoutt
03-08-2005, 03:37 PM
looks good to me

AaronCampbell
03-08-2005, 03:42 PM
Seems good to me.

EDIT: Scoutt wins again

scoutt
03-08-2005, 03:45 PM
MUWAHHHHAAAAHHAHAHAHAH :P