Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
Contact the Webmasters of RCFContact   Invite a friend to Join usRecommend   Chat in IRCChat   EZ Template Change OptionEZStyle   Listen to Internet Radio while you browse...iRadio   See your private message.Login for PMs   Important LinksLinks
Member Website LinksWeb Links   Play/View our GamesGames   Register.Register
calendar_open_closeCalendar 
SQL error
Post new topic   Reply to topic View previous topic :: View next topic
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support Add To Bookmarks
SQL error
PostPosted: 01/30/2006 4:44 AM Reply with quote
Citation
Glenn I
Citation
Posts 2152
Word Cnt. 78,257
BDay Jun 15
Sign Gemini
Sex Sex:Male
Joined: Apr 22, 2005
Local time: 12:09 AM
Location: Upside down
australC_1xa.gif
Sometimes I get an SQL error when I enter the ACP. Here is the error

Code:
Could not obtain regd user/online information

DEBUG MODE

SQL 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 'WHERE page_id = 2230' at line 1

SELECT forum_name, forum_id FROM phpbb_forums

Line : 574
File : index.php


Any ideas about this?
Back to Top
View user's profile Find all posts by Glenn I Send private message   Visit poster's website Phoogle Map
SQL error
PostPosted: 01/31/2006 4:55 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 10:09 AM
Location: St Pete, FL
peace.gif
So where do you see this error?  I checked in your index.php file in your root and this query is not even run in that file.  I checked the index.php file in your admin folder and the query was run on line 395, not 574.  And the query that is there is valid...

dontknow
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: SQL error
PostPosted: 01/31/2006 5:02 AM Reply with quote
Citation
Glenn I
Citation
Posts 2152
Word Cnt. 78,257
BDay Jun 15
Sign Gemini
Sex Sex:Male
Joined: Apr 22, 2005
Local time: 12:09 AM
Location: Upside down
australC_1xa.gif
Was getting it sometimes as I entered the ACP. It seems ok now though.
Back to Top
View user's profile Find all posts by Glenn I Send private message   Visit poster's website Phoogle Map
SQL error
PostPosted: 01/31/2006 5:16 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 10:09 AM
Location: St Pete, FL
peace.gif
Strange that this would happen in your Admin index.php file.  Unless you've installed a bunch of MODs since you posted, the error message doesn't seem to match the location where the code is defined and run...

dontknow
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
SQL error
PostPosted: 01/31/2006 5:20 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 10:09 AM
Location: St Pete, FL
peace.gif
Ok, I just found a bug in your code that would explain the incorrect error message but not explain why you see it occasionally.  Here is the code:

Code:
        $sql_tpl = "SELECT page_name WHERE page_id = $page_id";
        if ( !($result_tpl = $db->sql_query($sql_tpl)) )
        {
     message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql);
        }

The SQL variable is $sql_tpl yet in the error message, they use $sql, which is wrong.  It needs to be $sql_tpl.  That won't make the problem go away, but it will report correctly if/when it occurs again...

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
SQL error
PostPosted: 01/31/2006 5:26 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 10:09 AM
Location: St Pete, FL
peace.gif
Ok, I see your syntax error.  This is the SQL code that is failing:

Code:
$sql_tpl = "SELECT page_name WHERE page_id = $page_id";


SQL code is always in the same order.  It is GIVE ME information FROM some table WHERE something matches something...

Notice that this query doesn't say which table to grab the information from.  This code is from the Blank Template MOD and there are 2 errors in less than 3 lines of code.  I hope the rest of the code from this MOD is in better shape or you're in trouble...

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: SQL error
PostPosted: 01/31/2006 5:46 AM Reply with quote
Citation
Glenn I
Citation
Posts 2152
Word Cnt. 78,257
BDay Jun 15
Sign Gemini
Sex Sex:Male
Joined: Apr 22, 2005
Local time: 12:09 AM
Location: Upside down
australC_1xa.gif
So what do I do about it then?
Back to Top
View user's profile Find all posts by Glenn I Send private message   Visit poster's website Phoogle Map
SQL error
PostPosted: 01/31/2006 5:54 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 10:09 AM
Location: St Pete, FL
peace.gif
The MOD author screwed up his SQL query in 3 places, twice in your admin/index.php file and once in your viewonline.php file.  I have corrected those queries along with the error message report error that was in two separate places.  Let's hope (s)he didn't make any other serious mistakes like this...

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: SQL error
PostPosted: 01/31/2006 6:01 AM Reply with quote
Citation
Glenn I
Citation
Posts 2152
Word Cnt. 78,257
BDay Jun 15
Sign Gemini
Sex Sex:Male
Joined: Apr 22, 2005
Local time: 12:09 AM
Location: Upside down
australC_1xa.gif
prayer  prayer  prayer

Thanks for that.  sunny
Back to Top
View user's profile Find all posts by Glenn I Send private message   Visit poster's website Phoogle Map
SQL error
PostPosted: 01/31/2006 6:23 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 10:09 AM
Location: St Pete, FL
peace.gif
Since my changes are completely untested, then it is possible that they too may contain errors.  It's also possible that I didn't see other errors from the Blank Template MOD.  So don't be surprised if this needs more modification down the road...

It appears that you might have gotten this error in your ACP when a guest was reading one of the Templates you created with this MOD.  That's why it didn't happen all the time.  That is my guess anyway...

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT - 5 Hours

Page 1 of 1


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group
  ImageShack  
  Putfile  
  TinyURL  
  CommonDreams  
  Log in  

Page generation time: 0.1465s (PHP: 73% - SQL: 27%) - SQL queries: 61 - GZIP enabled - Debug on