this is a portion of a php script that modifies the posts in phpBB2, could be used for search and replace...
$sql = "SELECT post_id, post_text FROM " . POSTS_TEXT_TABLE . " WHERE bbcode_uid=''";
if( !($result_tmp = $db->sql_query($sql)) ) {
echo "Could not get posts_text information ($sql)<br>";
}
if( ($row_tmp = $db->sql_fetchrow($result_tmp)) ) {
do
{
$post_id = $row_tmp['post_id'];
$post_text = stripslashes($row_tmp['post_text']);
$bbcode_uid = make_bbcode_uid();
$post_text = prepare_message(trim($post_text), false, true, false, $bbcode_uid);
$sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text='" . addslashes($post_text) . "', bbcode_uid='" . $bbcode_uid . "' WHERE post_id=" . $post_id;
echo '.';
if( !$db->sql_query($sql) ) {
echo "<br>Couldn't update posts_text $post_id ($sql)<br>";
}
} while( $row_tmp = $db->sql_fetchrow($result_tmp) );
}