Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2003
Posts: 6
Lurker
Lurker
Offline
Joined: Mar 2003
Posts: 6
I have a wierd problem which has just started since our admin upgraded our server.

Current s/w versions are UBB6.2.3, PHP 4.3.1, MySQL 3.23.49, Apache 1.3.27

I have written a package which uses the UBB user-id for the username. So, the first thing I do is to check the UBB authentication of the user:
Code
 <br />require ("/blah/ubbthreads/main.inc.php"); <br />require ("/blah/ubbthreads/languages/${$config['cookieprefix']."w3t_language"}/ubbthreads.php"); <br /> <br />$userob = new user; <br />$user = $userob -> authenticate("U_Username,U_PicturePosts,U_ShowSigs,U_Email,U_PictureView, <br />U_Status,U_Privates,U_Name,U_Title,U_Totalposts,U_Visible, U_Laston,U_Language,U_TimeOffset, <br />U_Groups,U_Picture,U_Number"); <br /> <br />$html = new html; <br />


Once this is done, I load my code and login to the db with a separate user and select my database:
Code
 <br />require_once("mycode.php"); <br /> <br />$db = mysql_connect("localhost", $dbuser, $dbpass); <br />mysql_select_db("mydb", $db); <br />


Now, the problem is that when the UBB authenticate() function is called, it makes a query on the database. However, the db query fails because it appears to be attempting to access "mydb.xxxxx" (sorry, can't recall the table name off-hand). The issue is that is appears to be trying to use mydb rather than the UBB database - even though the mysql_select_db() has not yet been run to connect to mydb.

From what I can tell from the PHP/MySQL status, there is a single persistent connection to MySQL, which I assume belongs to UBB.

This all worked fine before the upgrade, but I can't think for the life of me why it is failing now.

Anyone got any ideas of why it is failing or things I might try ?

Sponsored Links
Joined: Mar 2003
Posts: 6
Lurker
Lurker
Offline
Joined: Mar 2003
Posts: 6
I think I should add that UBB works fine on its own.

Joined: Mar 2003
Posts: 6
Lurker
Lurker
Offline
Joined: Mar 2003
Posts: 6
Ah, I now have the answer to this problem.

The sysadmin had given the UBBThreads db the same login id and password as my database, so they had ended up sharing the connection which became a problem when my code selected a different database.

Fixed by adding an extra parameter to mysql_connect in my code:

$db = mysql_connect("localhost", $dbuser, $dbpass, true);


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)