Replacing characters in table

I have a mysql table with close to 3000 entries in it, some of the entries have the ‘&’ character and i want to replace it with ‘&’, I have tried

$sql = mysql_query(‘SELECT column FROM table’);

[code]$i=0;
while($row=mysql_fetch_assoc($sql)) {
$string = preg_replace("&","&",$i);
mysql_query(“UPDATE table SET column = ‘$string’ WHERE id = ‘$i’”);

if($do) { echo ‘done
’; } else { echo ‘failed
’; }
$i++;
}[/code]

But this returns failed

Does anyone know of a way to do this

have you looked at http://us2.php.net/manual/en/function.h … lchars.php ?

if($do) { echo 'done<br>'; } else { echo 'failed<br>'; }

Where are you initializing $do?

Sorry I eant to close this thread, I ended up deleteing all entries so had to enter them 1 bt 1 anyway

Sponsor our Newsletter | Privacy Policy | Terms of Service