0 Members and 1 Guest are viewing this topic.
// search for matches and combine the results into complete data needed for making links if (count($result) < 150) { $matches = array(); $i = 0; $temp = $result; foreach($result as $record) { foreach($temp as $temp_record) if (strcmp($record["name"],$temp_record["name"]) == 0 && $record["ql"] > $temp_record["ql"]) { $matches[$i]["name"] = $record["name"]; $matches[$i]["highid"] = $record["id"]; $matches[$i]["lowid"] = $temp_record["id"]; $matches[$i]["highql"] = $record["ql"]; $matches[$i]["lowql"] = $temp_record["ql"]; if ($QL > 0 && $QL >= $matches[$i]["lowql"] && $QL <= $matches[$i]["highql"]) { $matches[$i]["ql"] = $QL; } else { $matches[$i]["ql"] = $matches[$i]["highql"]; } $i++; } } $j = 0; foreach($result as $record) { $match = 0; foreach($temp as $temp_record) { if (strcmp($record["name"],$temp_record["name"]) == 0 && $record["ql"] != $temp_record["ql"]) { $match=1; } } if ($match==0) { $matches[$i]["name"] = $record["name"]; $matches[$i]["lowid"] = $record["id"]; $matches[$i]["highid"] = $record["id"]; $matches[$i]["lowql"] = $record["ql"]; $matches[$i]["highql"] = $record["ql"]; $matches[$i]["ql"] = $record["ql"]; $i++; } }