Upgrade error on membergroups

Started by orange, March 14, 2004, 07:40:33 AM

Previous topic - Next topic

orange

I decided to try out upgrading a copy of my YSE 1.5.5 forum to SMF, but on step 6 of the upgrade process I get this:

  Converting "membergroups"... Unsuccessful!
This query:
INSERT IGNORE INTO yabbse_membergroups
(ID_GROUP, groupName, onlineColor, minPosts, stars)
VALUES (1, 'Aztec Guy\'s Friend', '#FF0000', -1, '5#staradmin.gif'),
(2, 'Global Moderator', '#0000FF', -1, '5#stargmod.gif'),
(3, 'Moderator', '', -1, '5#starmod.gif'),
(4, 'Member', '', 0, '1#star.gif'),
(5, 'Member', '', 9999, '2#star.gif'),
(6, 'Full Member', '', 10000, '3#star.gif'),
(7, 'Senior Member', '', 25000, '4#star.gif'),
(8, 'AGS God', '', 50000, '5#star.gif'),
(19, 'Mittens Veteran', '', -1, ''),
(18, 'Mittens Crew', '', -1, ''),
(20, 'Mittens '02', '', -1, '');
Caused the error:

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 '02', '', -1, '')' at line 13


Presumably it's due to the fact that one of my membergroups has an apostrophe in its name - any ideas?

Chris Cromer

Yeah it is because of the apostrophe.

Just remove the apostrophe for now then do the upgrade... then after the upgrade you can put the apostrophe back.
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Grudge

Yea, or change it to \'
ie:
20, 'Mittens \'02', '', -1, '');
I'm only a half geek really...

orange

Hehe, well, I'd better not start hacking around in the upgrade.php for the sake of my own health ;)

Renaming the membergroup sounds like the best workaround then - I'll give that a go, cheers :)

[Unknown]

Actually, this is a problem caused by Settings.php not having certain things in it.

Open upgrade.php, and find the following:
(5, '$membergroups[4]', '', $JrPostNum, '2#star.gif'),
(6, '$membergroups[5]', '', $FullPostNum, '3#star.gif'),
(7, '$membergroups[6]', '', $SrPostNum, '4#star.gif'),
(8, '$membergroups[7]', '', " . (isset($HeroPostNum) ? $HeroPostNum : $GodPostNum) . ", '5#star.gif')" .


Replace it with:
(5, '$membergroups[4]', '', '$JrPostNum', '2#star.gif'),
(6, '$membergroups[5]', '', '$FullPostNum', '3#star.gif'),
(7, '$membergroups[6]', '', '$SrPostNum', '4#star.gif'),
(8, '$membergroups[7]', '', '" . (isset($HeroPostNum) ? $HeroPostNum : $GodPostNum) . "', '5#star.gif')" .


-[Unknown]

orange

Just to let you know, this error still occurs with beta 4.1 -- I presume upgrade.php is just missing an  addslashes  in this membergroups query, but you might want to get it fixed.

Advertisement: