I have a simple table in my db it’s called words it has one colum called Autofill in that colum there are a bunch of keywords and each client can set thier keywords and it updates that table unless that word all ready exists in the table. it it does exist it is suposed to replace the word and not have a duplicate.
[code=php]$wordarray = explode(” “,trim($keywords));
//$wordquery = implode(“‘), “,$wordarray);
$sqlvalues .= “VALUES (‘”.implode(“‘), (‘”,$wordarray).”‘)”;
$ignorequery = “REPLACE `Chamber_DB`.`words` (`Autofill`) $sqlvalues”;
//print_r($wordarray);
//echo($ignorequery);
//echo($sqlvalues);
$result = mysql_query ($ignorequery) or die(“Error ” . mysql_errno( ) . ” : ” . mysql_error( ));
if ($result==true){
echo “The Words Database Has Been Updated”;
}
else
{
echo “The Words Database was not updated!”;
}
Problem is it is inserting the words into the table but I am getting dulicates so the replace query is not working