<?php
$con = mysql_connect("localhost","peter","123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$result = mysql_query("SELECT * FROM phpbb_posts");
if(!$result) die("Query Failed.");
//is this right?
$row['post_text'] = $newrow;
$newrow = preg_replace('/(class="postlink")/','class="postlink" rel="nofollow" target="_blank"',$newrow);
$result = mysql_query("UPDATE phpbb_posts SET post_text=$newrow");
?>
So for each row in phpbb_posts it will get the text, change the link and then it will store it in newrow. From there it will now update the row with the replaced url.How does this look? I know it's probably wrong.
I want to be able to check all posts in my forum and replace a certain string with a new one. How can this be done?












