Advertisement:

Author Topic: Upgrade error on membergroups  (Read 6435 times)

Offline orange

  • Jr. Member
  • **
  • Posts: 111
  • Gender: Male
Upgrade error on membergroups
« on: March 14, 2004, 07:40:33 AM »
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?

Offline Chris Cromer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,745
  • Gender: Male
  • I am just a figment of your imagination!
    • Chris's AGI Web Site
Re: Upgrade error on membergroups
« Reply #1 on: March 14, 2004, 07:42:22 AM »
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.

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Upgrade error on membergroups
« Reply #2 on: March 14, 2004, 08:51:05 AM »
Yea, or change it to \'
ie:
20, 'Mittens \'02', '', -1, '');
I'm only a half geek really...

Offline orange

  • Jr. Member
  • **
  • Posts: 111
  • Gender: Male
Re: Upgrade error on membergroups
« Reply #3 on: March 14, 2004, 09:09:23 AM »
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 :)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Upgrade error on membergroups
« Reply #4 on: March 14, 2004, 05:02:59 PM »
Actually, this is a problem caused by Settings.php not having certain things in it.

Open upgrade.php, and find the following:
Code: [Select]
(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:
Code: [Select]
(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]

Offline orange

  • Jr. Member
  • **
  • Posts: 111
  • Gender: Male
Re: Upgrade error on membergroups
« Reply #5 on: April 04, 2004, 03:03:15 PM »
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.