My Invision Board Stopped Working


#1

just today I started getting this message when I tried to log onto my board;

mySQL query error: SELECT mod.mid as is_mod, m.id, m.name, m.mgroup, m.password, m.email, m.allow_post, m.view_sigs, m.view_avs, m.view_pop, m.view_img, m.auto_track, m.mod_posts, m.language, m.skin, m.new_msg, m.show_popup, m.msg_total, m.time_offset, m.posts, m.joined, m.last_post, m.last_visit, m.last_activity, m.dst_in_use, m.view_prefs, g.* FROM ibf_members m LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) LEFT JOIN ibf_moderators mod ON (mod.member_id=m.id OR mod.group_id=m.mgroup ) WHERE m.id='10'

mySQL 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 ‘mod ON (mod.member_id=m.id OR mod.group_id=m.mgroup )
WHERE m.’ at line 6
mySQL error code: 1064
Date: Wednesday 01st of June 2005 02:24:36 AM

I need help lot of members and email all the time about the board being down.

#2

I had this issue too. Go to sources/functions and find the one occurance of mod (where it isnt attached to anything) i.e. this line: mod ON (mod.member_id=m.id OR mod.group_id=m.mgroup

and change it to mod (note its ` and not ').

i.e.

mod ON (mod.member_id=m.id OR mod.group_id=m.mgroup

This was kindly sorted for me by Jason of the support team today :slight_smile:


#3

May I ask what version of IPB? I’m a bit curious why I don’t have the problem. I’m running v2.0.4 with no mods.


#4

[quote]May I ask what version of IPB? I’m a bit curious why I don’t have the
problem. I’m running v2.0.4 with no mods.

[/quote]

I’m not sure about the different versions, etc. but the problem here is that with the new version of MySQL, ‘mod’ (and ‘div’) are reserved words. You need to backtick-quote such table names if they are used, but it’s best to either not use them at all or upgrade to software that changes them.

  • Jeff @ DreamHost
  • DH Discussion Forum Admin

#5

Oh dear, so I presume my board will fail as soon as its mysql server is upgraded. Oh, that’s a sad thought.

Edit: Hmm. That string does not occur in sources/functions.php in my install. Good news or bad? Only time will tell :-/


#6

Invision’s commercial, right? I’d b* at the developers then for poor coding. :wink:


#7

[quote]Invision’s commercial, right? I’d b* at the developers then for
poor coding. :wink:

[/quote]

To be fair, I suspect that it’s not really a case of poor coding - I assume that the latest version of the software (anything after MySQL v4 or v4.1 came out) fixes this.

A good rule of thumb, however: It pays to use somewhat ‘verbose’ and unique table and variable names.

  • Jeff @ DreamHost
  • DH Discussion Forum Admin

#8

[quote]To be fair, I suspect that it’s not really a case of poor coding - I assume that the latest version of the software (anything after MySQL v4 or v4.1 came out) fixes this.

A good rule of thumb, however: It pays to use somewhat ‘verbose’ and unique table and variable names.
[/quote]
This is true and being MySQL 4.1 has been out for over a year, there’s definatly should be an updated version of Invision you can upgrade to.

One of many reasons why one should always keep their software upto date…


#9

which is fine…unless u have some dodgy botch hack between a gallery and the forum and know nothing about php or MySQL :stuck_out_tongue:


#10

Maybe you should have thought of that before gettins dome dody botch hack done. :stuck_out_tongue:

Ha, always make sure you have support for your software. Especially if you don’t know how to do it yourself. There’s too many security holes found on a daily bases in everyday software, you really gotta know how to patch/upgrade your scripts.


#11

well I had to do it myself based on what was available at the time. Couldnt/cant afford to pay anyone and it serves the purpose perfectly well.


#12

Iwas just giving you a hard time. Sorry if you took that seriously.

Here’s what I’ve learned in the past when hacking BB code; Save what I’ve done.

I always export everything i did to some junk text file with all the commands I used and I document every change in the code with // PG (my initials). This allows me to do a quick find . -name “*.php” | xargs grep “// PG” to locate all changes I’ve done.

It makes it much easier to re-add my “mods” after an upgrade of some type.

Also, I know phpBB counts on people moding their forums. Cause of this, they supply patches which can be applied using patch command (they give instructions). This allows you upgrade your forum by applying a patch and providing none of your changes conflict, the patch will work around your code.