|
Joined: Jun 2002
Posts: 375
Enthusiast
|
Enthusiast
Joined: Jun 2002
Posts: 375 |
I'm getting an error of:
SQL ERROR: Database error only visible to forum administrators
after the upgrade from 6.0.3 to 6.1br1. This is when I am using the ubbt cookie and groups to allow a user to modify information in a new table in the ubbt database. This is a table I made, not part of ubbt. This used to work great, but after the upgrade, it seems the security has changed, or the cookie is different. So I am basically needing to know what changed with ubbt that would give this error, so I can make adjustments to my site for it. I have looked over much of the new code, but have yet to see anything that would cause a conflict.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Sounds like it might be the cookie changes, log out, clear your cookie, then log back in and see if it's cleared up.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
There is a table prefix and a cookie prefix being used in 6.1 so you should make sure that the prefixes match your old table prefix and cookie prefix which were hard coded in before. (w3t_)
|
|
|
|
Joined: Jun 2002
Posts: 375
Enthusiast
|
Enthusiast
Joined: Jun 2002
Posts: 375 |
HMM, upon further investigation and testing, it seems that the data IS updated in the database, but that error is given. I can still verify they are a member of a group ok, but this error is very annoying and causing major confusion with users. I have the table name hardcoded into the page that UPDATES or INSERTS into the table. I have cookies set sitewide, with no special prefix set since I only have one public board. (The other is a test site) I deleted all cookies and started over and it still happens. I use this code at start of page to grab the cookie. code:
$PathToThreads = "c:/inetpub/wwwroot/www.newoutriders.org/ubbthreads/";
require ("{$PathToThreads}main.inc.php"); $userob = new user; $user = $userob -> authenticate(U_Groups,U_Username); $html = new html;
Any more thoughts?
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
In your mysql.inc.php file change this: code: $What = find_environmental ("SCRIPT_NAME"); if ( ($user['U_Status'] != "Administrator") && ( (!stristr($What,"createtable")) && (!stristr($What,"altertable")) && (!stristr($What,"ubbimport.php")) ) ) { $error = "Database error only visible to forum administrators"; } else { $this->errordesc = mysql_error(); }
to this: code: $What = find_environmental ("PHP_SELF"); if ( ($user['U_Status'] != "Administrator") && ( (!stristr($What,"createtable")) && (!stristr($What,"altertable")) && (!stristr($What,"ubbimport.php")) ) ) { $error = "Database error only visible to forum administrators"; } else { $this->errordesc = mysql_error(); }
And see if that will give you a more descriptive error message. Then post the error message here. I think I'll mention this change to Scream and see if this needs to be added to 6.1 as I have never been able to get a descriptive error message either. This could be do to how php is set and what environmentals are avialable to the users too.
Last edited by Dave_L; 09/16/2002 5:57 PM.
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
If you mention that, also mention that if the SQL error is suppressed, it should be appended to a log file, with a timestamp, IP and username. The same timestamp should also be included in the displayed " ... only visible ..." message, to facilitate matching it up with the full message in the log file. That would be helpful for user-reported MySQL errors, as well as ones that you get yourself.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
Well perhaps that's not the problem then. Are you logged in as an Admin and can the script that is generating the errors read the cookie to verify your status?
The sql error is more descriptive than the one displayed to non admins...
|
|
|
|
Joined: Jun 2002
Posts: 375
Enthusiast
|
Enthusiast
Joined: Jun 2002
Posts: 375 |
I do not get this error when loged in as an admin, only on a non-admin login.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
Ok then let's just show everyone the actual error then so we can get an idea of what it is. change this: code: $What = find_environmental ("SCRIPT_NAME"); if ( ($user['U_Status'] != "Administrator") && ( (!stristr($What,"createtable")) && (!stristr($What,"altertable")) && (!stristr($What,"ubbimport.php")) ) ) { $error = "Database error only visible to forum administrators"; } else { $this->errordesc = mysql_error(); }
to this: code: $What = find_environmental ("SCRIPT_NAME"); if ( ($user['U_Status'] != "Administrator") && ( (!stristr($What,"createtable")) && (!stristr($What,"altertable")) && (!stristr($What,"ubbimport.php")) ) ) { $error = "Database error only visible to forum administrators"; $this->errordesc = mysql_error(); } else { $this->errordesc = mysql_error(); }
in your mysql.inc.php file and then login as a non admin user and see what the error could be.
Last edited by Dave_L; 09/16/2002 8:07 PM.
|
|
|
|
Joined: Jun 2002
Posts: 375
Enthusiast
|
Enthusiast
Joined: Jun 2002
Posts: 375 |
Still the same error, no additional error message given to non-admin. Still works fine with no error for admin.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
That's odd. I thought there would be a description with any sql error. It's hard to say what the problem is untill we can see what is causing the error with mysql.
|
|
|
|
Joined: Jun 2002
Posts: 375
Enthusiast
|
Enthusiast
Joined: Jun 2002
Posts: 375 |
This is too weird, a reboot did no good. Maybe I'll check for a MySQL upgrade, I know I'm one version of PHP behind too. The same code works fine on a different section of the website with a different table of it's own. Maybe I'll check to see if this table got corrupted. If that fails, then I'll kick the server!
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 70
Joined: January 2007
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|