I'm trying to find which function fits the script. My objective is to find all the records where there are including the misspellings (nbsp;, nbsp,  ) and replace them with the space bar " ": $sql = "SELECT * FROM ".$acronym."_pages WHERE content LIKE '%nbsp%'"; $result = mysql_query($sql) OR exit( 'Error: ' . mysql_error() ); //echo $sql; function nbspSearch(){ //insert code here } while($row = mysql_fetch_array($result)){ sql2 = "UPDATE ".$acronym."_pages SET content = '".str_replace(nbspSearch(), " ", $row['content'])."' WHERE content = '".$row['content']."'"; } mysql_close($con); PHP: If anyone has a better suggestion than mine let me know. Thanks.
At the moment I got things working but thanks for the info. I need to study php and mySQL in depth! There's no end to studying!
$rep=array(' ',' ','nbsp;','nbsp'); $new=str_replace($rep,' ',$row['content']); end then mysql update.