"; $replace = "[quote]"; for($i=0; $i<$num_results; $i++) { $row = mysql_fetch_array($result); $text = $row['xar_text']; $id = $row['xar_cid']; $text = preg_replace($pattern, $replace, $text); $text = str_replace("'", "\'", $text); $query = "update xar_comments set xar_text = '$text' where xar_cid = $id"; echo('

'.$query.'

'); mysql_query($query) OR die(mysql_error()); echo('

'.$row['xar_text'].'

'); } ?>