2006-01-06, 10:31 PM
I made a little script which I used with MyBB 1.0 PR2. When you change your domain the script searches in your posts for the old URL and replaces them with the new one. It worked perfertly.
But now I get the MySQL-Error 1064 everytime no matter what I try. Any ideas?
The Script:
But now I get the MySQL-Error 1064 everytime no matter what I try. Any ideas?
The Script:
<?php
require "./global.php";
// Hier URLs einsetzen
$url_alt = "http://www.url_alt.de";
$url_neu = "http://www.url_neu.de";
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts");
while($p = $db->fetch_array($query))
{
$db->query("UPDATE ".TABLE_PREFIX."posts SET message='".$p['message'] = str_replace($url_alt, $url_neu, $p['message'])."' WHERE pid='".$p[pid]."'");
echo "Aktualisiere Post ".$p['pid']."<br />\n";
}
?>