php - Faster way for this mysql_query -
$handle = fopen("stock.csv", "r"); while (($data = fgetcsv($handle, 1000, ";")) !== false) { $model = mysql_real_escape_string ($data[0]); $quantity = mysql_real_escape_string ($data[7]); mysql_select_db("verradt33_xoho", $link); $quantity = str_replace("ja", "10", $quantity); $quantity = str_replace("nee", "0", $quantity); $result = mysql_query("update dev_product set quantity = $quantity model = '$model'") or die(mysql_error()); even tho code works, takes long time process 7000+ lines in csv. due having replace ja or nee 10 or 0 every single line. is there way make faster? can't touch csv file, that's hard part of course. current load time 40 minutes. your first question should be: is column model indexed? secondly, try commenting out database access's , see how long takes .csv processing! mysql_select_db("verradt33_xoho",...