Could not obtain regd user/online information

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
kenerly
Registered User
Posts: 79
Joined: Fri May 23, 2003 6:25 am

Could not obtain regd user/online information

Post by kenerly »

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 = 2335' at line 1

SELECT forum_name, forum_id FROM phpbb_forums

Line : 409
File : index.php


Here is line 409 from index.php

Code: Select all

'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
The weird thing is I have not done anything(mods, etc) today. This just popped up when I logged in as admin.
Any idea where I should look.

Thanks
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Could not obtain regd user/online information

Post by espicom »

It doesn't have to be something you did TODAY, just what you did today to trigger it...

The select statement in question is not in index.php, so it is probably in one of the include files. What were you trying to do when you logged in? That is, were you answering the second, "i want into the Admin Control Panel" login prompt?
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer
kenerly
Registered User
Posts: 79
Joined: Fri May 23, 2003 6:25 am

Re: Could not obtain regd user/online information

Post by kenerly »

The error happens after I log in the ACP. The error displays on the right half of screen, all the admin options load fine on the left side.
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Could not obtain regd user/online information

Post by espicom »

The strange thing is that it would appear that something is getting appended to the query, but not completely; you got the error message saying that the WHERE page_id = 2335 portion of the query was bad, but the query, as printed in the error message doesn't have a WHERE clause... and the error report is associated with a completely different SQL query!

Here is the code associated with the debug message:

Code: Select all

	$sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_page, s.session_logged_in, s.session_ip, s.session_start 
		FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s
		WHERE s.session_logged_in = " . TRUE . " 
			AND u.user_id = s.session_user_id 
			AND u.user_id <> " . ANONYMOUS . " 
			AND s.session_time >= " . ( time() - 300 ) . " 
		ORDER BY u.user_session_time DESC";
	if(!$result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql);
	}
And here is the code, further down, that is associated with the query that get printed in the error message:

Code: Select all

	$sql = "SELECT forum_name, forum_id
		FROM " . FORUMS_TABLE;
	if($forums_result = $db->sql_query($sql))
	{
		while($forumsrow = $db->sql_fetchrow($forums_result))
		{
			$forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name'];
		}
	}
	else
	{
		message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
	}
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer
Locked

Return to “2.0.x Support Forum”