I need to replace single quotes in my mysql database and im using a script to do this. It works well with other characters but when it comes to single quotes it doesnt work at all.

```
$sql[$handle]['sql'] = 'UPDATE '.$table.' SET '.$field.' = REPLACE('.$field.',\''.$search[$i].'\',\''.$replace[$i].'\')'

```

I get this error when trying to replace single quotes:

> 
> You have an error in your SQL syntax; check the manual that
>  corresponds to your MySQL server version for the right syntax to use
>  near '''','')' at line 1)
> 
> 
> 

This is the string I use to search for the quote: `$search[] = ('\'');`