FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Issue with consist.php (You have an error in your SQL syntax)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Issue with consist.php [message #166589] Fri, 27 January 2012 01:09 Go to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

A user reported that trying to reply to a thread failed. I tried and the site presented you with a blank page with no source.

So I ran a consistency check and it stopped here:


Locking the database for checking
Locked!
Validating category order
Done: Validating category order
Checking if moderator and users table match


The error logs are saying this:

(.../include/theme/default/db.inc:72
.../public_html/adm/consist.php:72
.../public_html/adm/consist.php:17 7
) 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 'mm FROM amod mm LEFT JOIN ausers u ON mm.user_id=u.id LEFT JOIN aforum f ON f.id' at line 1
Query: DELETE amod mm FROM amod mm LEFT JOIN ausers u ON mm.user_id=u.id LEFT JOIN aforum f ON f.id=mm.forum_id WHERE u.id IS NULL OR f.id IS NULL


I found this thread but the patch won't apply to my consist.php
http://fudforum.org/forum/index.php?t=msg&th=119924

I am running FudForum 2.8

I think I need to accelerate that plan to upgrade. But right now, I have the forum disabled as the last it was enabled, forums had no threads in them but thread counts and multiple pages in the forum (1,2,3,4 links etc) were all there.

Any advice appreciated.



[Updated on: Fri, 27 January 2012 01:11]

Report message to a moderator

Re: Issue with consist.php [message #166590 is a reply to message #166589] Fri, 27 January 2012 02:21 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
MySQL 5.5 is new, FUDforum 2.8 is very, very old.

The best thing you can do is to upgrade your forum right away. The threads and everything else will re-appear after the upgrade (and successful consistency check).
Re: Issue with consist.php [message #166591 is a reply to message #166590] Fri, 27 January 2012 07:16 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

naudefj wrote on Fri, 27 January 2012 13:21

MySQL 5.5 is new, FUDforum 2.8 is very, very old.

The best thing you can do is to upgrade your forum right away. The threads and everything else will re-appear after the upgrade (and successful consistency check).


Thanks naudefj
I think I will do that. It has been on my to-do list for quit some time and an opportunity to do it was coming up next week. Bugger.

I hope there hasn't been any damage to my DB in the mean time.

The host upgraded from MySQL 5.5.18 to 5.5.19 last night. Makes me think that triggered this issue, but such a minor upgrade....I am not too sure.
Re: Issue with consist.php [message #166592 is a reply to message #166591] Fri, 27 January 2012 07:30 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

How do I confirm what version I do in fact have?

On the file system the latest tarball I have is: FUDforum_upgrade_zl_2-8-1.tar.bz2 (dated 21st May 2009)

Yet on the Admin page I have:

FUDforum: 3.0.0
PHP: 5.3.9
Database: mysql (mysql)
DB version: 5.5.19

Re: Issue with consist.php [message #166594 is a reply to message #166592] Fri, 27 January 2012 08:29 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Ok I did a backup (forumdump) and then extracted the upgrade.php from 3.0.3 and placed it into my web root.

Called it from a browser and got this:

Fatal error: Call to undefined function db_version() in /home/wspirates/domains/forums.wspirates.com/public_html/upgrade.php on line 620


Looking at line 620 we see:


$dbver = db_version();


I did a search in the upgrade.php file for the decleration of the function db_version and it is not seen at all.
It looks like an error in the construction of the latest upgrade.php file.


Re: Issue with consist.php [message #166596 is a reply to message #166594] Fri, 27 January 2012 08:50 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Just reading here:
http://fudforum.org/forum/index.php?t=msg&th=120110&goto=165762& ;#msg_165762

db_version is not defined in the upgrade.php script but from reading this I think naudefi is saying that it should be in sql/mysql/db.inc

So I had a look and I see in the upgrade script it includes db.inc

$dbinc = $GLOBALS['DATA_DIR'] .'sql/'. $GLOBALS['DBHOST_DBTYPE'] .'/db.inc';

But that function is missing.

I am tempted to hard code it into the upgrade script but I am concerned I will find other errors with the script and get myself caught in a real bad situation.

[wspirates@shared forums.wspirates.com]$ ls FUDforumwsp/sql/mysql/db.inc
FUDforumwsp/sql/mysql/db.inc
[wspirates@shared forums.wspirates.com]$ grep db_version FUDforumwsp/sql/mysql/db.inc
[wspirates@shared forums.wspirates.com]$


Re: Issue with consist.php [message #166597 is a reply to message #166596] Fri, 27 January 2012 08:51 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Oh I see a get_version function defined in db.inc. That might do it, but I am concerned to make changes to upgrade.php with these issues.

Re: Issue with consist.php [message #166601 is a reply to message #166597] Sat, 28 January 2012 02:14 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

I really must have 3.0.0 as I checked include/core.inc too and it agreed. Still don't know why I don't have this db_version() function.
I renamed the call for db_version() in the upgrade.php script to get_version() which looks to do what the upgrade script wanted (get_version is in sql/mysql/db.inc on my install)

Ran the upgrade and no stuck at q_limit() being called but not defined.

So exact same issues as this thread:

http://fudforum.org/forum/index.php?t=msg&th=120110&goto=165760& ;#msg_165760

Although my q_limit() call is on 967 not 954

I see q_limit defined in sql/mysql/db.inc at line 172 though. But I see that file was edited 5 mins ago, so maybe added during that upgrade attempt...

Ahh yes I am right. I see db_version in sql/mysql/db.inc now and get_version has gone away.

Re-running upgrade.php after editing it back to db_version.....

Re: Issue with consist.php [message #166602 is a reply to message #166601] Sat, 28 January 2012 02:18 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Ok ran through this time. Ran the consistency checker. It removed some unowned PM's and messages. Completed fine otherwise.

Clicked to run SQL optimizer and a blank web page. Tried accessing the admin page and the forum itself...all blank pages with no source code. There is a php error here I guess..... Sad

Re: Issue with consist.php [message #166603 is a reply to message #166602] Sat, 28 January 2012 02:20 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/wspirates/domains/forums.wspirates.com/FUDforumwsp/include/GLOBALS.ph p on line 12

Re: Issue with consist.php [message #166604 is a reply to message #166603] Sat, 28 January 2012 02:32 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Ok fixed that. Ended up being the GLOBALS.php file having Mac line endings on some lines and VI was recognising the file as a Mac file too.

Now the error I have is:

PHP Notice: Undefined variable: last_msg_id in /home/wspirates/domains/forums.wspirates.com/public_html/theme/wsp02/index. php on line 172

Re: Issue with consist.php [message #166605 is a reply to message #166604] Sat, 28 January 2012 02:33 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Right that is my theme that didn't survive the upgrade. So I need to change the forums default theme. (I should have done that before the upgrade d0h!)

Is there a way to do that in the DB?
Re: Issue with consist.php [message #166606 is a reply to message #166605] Sat, 28 January 2012 03:14 Go to previous message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Ok I have managed to change my logins default theme using mysql on the CLI and then changed all users. So forum is working now.
Just need to recreate my theme again.

Thanks all.

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: When I post...
Next Topic: Disabled forum message saving in GLOBALS.php with \r\n
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 11:38:57 GMT 2024

Total time taken to generate the page: 0.02665 seconds