I cannot use 'ON DUPLICATE VALUE' to update/replace values as this is only available on MySQL 4.1+ and my host runs Mysql 4.0.21.
Therefore can you clarify that I can use REPLACE into as I have tried this without success:
here is my code- how do I adapt it so it uses REPLACE...
$values = array();
foreach($scorearray as $key => $score)
{
// each element will be a parenthesized list of values:
$values[] = sprintf("('%s','%s',%d,'%s')", $username, $qualitysystem[$key], $score, $searchurl[$key]);
}
// merge values into sequence of comma-separated value lists:
$valueList = implode(',', $values);
// create the SQL:
$sql = "INSERT INTO `qualityuserscores` (`username`, `qualitysystem`, `score`, `search_url`) VALUES $valueList";
$result = mysql_query($sql) or exit(mysql_error());
}