MyBB Community Forums

Full Version: fix-slashes.php isn't working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
The file did not work for me because
".TABLE_PREFIX."
is missing.
Same here. I get:

POSTS
mySQL error: 1146
Table 'xoxox_forums.posts' doesn't exist
Query: SELECT * FROM posts
me too i get the same error Idren, its missing the prefix before "posts" i think.
same error
Replace the code in fix-slashes.php with the following. It worked fine for me. Big Grin

<?php
require "./global.php";
echo "POSTS<br />\n\n";
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts");
while($p = $db->fetch_array($query))
{
	$db->query("UPDATE ".TABLE_PREFIX."posts SET message='".stripslashes(addslashes($p['message']))."', subject='".stripslashes(addslashes($p['subject']))."' WHERE 

pid='$p[pid]'");
	echo "Updating $p[pid]<br />\n";
}
echo "THREADS<br />\n\n";
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads");
while($t = $db->fetch_array($query))
{
	$db->query("UPDATE ".TABLE_PREFIX."threads SET subject='".stripslashes(addslashes($t['subject']))."' WHERE tid='$t[tid]'");
	echo "Updating $t[tid]<br />\n";
}

?>
Sorry, use the attached file
i get this error when using that Chris Sad

POSTS
Updating 1
Updating 2
Updating 3
Updating 4
mySQL error: 1064
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 't been able to see this guy play much, is he any good, does he
Query: UPDATE mybb_posts SET message=' I haven't been able to see this guy play much, is he any good, does he show any promise at the plate or in the field, or his he just a career backup? ', subject='' WHERE pid='5'
I got the same error. But it worked! Thanks!
rage: Did you have the slashes problem before you ran fix-slashes.php?
Chris Boulton Wrote:rage: Did you have the slashes problem before you ran fix-slashes.php?

nope, but i remeber something happened when converting from phpbb but i dont remember if it was the slashes i think it was the bbcodes or something. But no before converting it was fine.
Pages: 1 2 3