Linked database issue?

This one had me baffled for several hours:

The main script was in the root directory with a database AAA. It was a working script with around 800 members, but it wasn't very busy.

The test script was in root/test with a database BBB and I was the only person with access.

Both databases were virtually identical because I'd only just backed up, but the scripts varied a little.

The test script worked faultlessly but the main script kept throwing up SQL Query Errors claiming there was a duplicate primary key. It was particularly noticeable when members were trying to logon.

I eventually noticed that the test script was being updated. I saw a comment dated just a few hours earlier, then a few messages began to appear. I also discovered that if I logged off from the test script, then logged in on the main script, I was logged in to the test script also.

I renamed the test script's Index.php, then removed the database, but the SQL errors continued on the main database.

As the test database was more or less up-to-date, I deleted the main script and database, redirected the URL to the test script and all the problems went away.

I've always ran test scripts in a sub-directory of the main script and nothing like this has ever happened before.

Any clues?

Quote · 11 Mar 2018

Not without actually being able to look at things and since you have removed things that is now impossible and thus it is impossible to tell you what was going wrong.

Geeks, making the world a better place
Quote · 12 Mar 2018

So right, but I had a job to do, considering it was a working site that was being corrupted by the test site. Or was it visa-versa?

Quote · 12 Mar 2018

I often clone sites to a test site to check upgrades etc.  Sometimes I forget to change the domain or the database name in the header.inc.php file.  Of course it shows up right away and I can correct it before moving forward.  It was probably the same in your case.

Geeks, making the world a better place
Quote · 12 Mar 2018

All the header.inc links were fine. I've since cleaned up the entire site and hopefully all is now well.

The first sign of trouble was when I tried to log out of the test site and found I couldn't. I was still logged into the main site, but when I logged off there, I found I was also logged off the test site. 

 

Everything has been fine for weeks, but a day or so ago the main site started throwing up SQL Query errors stating there were duplicate primary keys.

Quote · 12 Mar 2018

 

All the header.inc links were fine. I've since cleaned up the entire site and hopefully all is now well.

The first sign of trouble was when I tried to log out of the test site and found I couldn't. I was still logged into the main site, but when I logged off there, I found I was also logged off the test site. 

 

Everything has been fine for weeks, but a day or so ago the main site started throwing up SQL Query errors stating there were duplicate primary keys.

Who knows; hard to find out now.  Could have been some session cookies since you stated you had issues with being logged on/off. 

Geeks, making the world a better place
Quote · 12 Mar 2018

Hello johnk42!

 

Need more details about your situation, at least 2 points: 1) how did you copy "test" script (was it copy of main script or new install); 2) details in messages about SQL errors.

 

With the best regards, Leonid

Quote · 14 Mar 2018

Hi Leoind,

The site was a copy. The original was in root/ and the copy in root/test/. Both header.inc.php files were correct.

The database was a new database with a copy of the original database imported. Otherwise it was untouched.

I'm only helping my friend and all error messages would have been sent to him. I did take a copy of the error, but forgot to take a copy of the message included.

I'll get permission from my friend to check his server emails to see if I can get the full text.

See attachment.

login.jpg · 46.9K · 168 views
Quote · 14 Mar 2018
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.