This topic is locked
[SOLVED]

  Database Connection problem

10/3/2013 2:29:35 PM
PHPRunner General questions
A
Andrew S author

I have a very weird problem which I have struggled to resolve and it is now causing me concerns making changes to a live site.
Details
I have a site which has been live for a customer since 1st January 2013. PHP Runner 6.2 and mySql database. This works fine and the database connection uses a specific IP address provided by the ISP.
As some serious changes are required, I have opened the project and saved as a different project called with Dev as part of the name in order to carry out requested changes and test before promoting to the live environment. I have alsed exported database using phpMyAdmin.
The test project and database is on a totally different server with a totally different ISP. For consistency (and this may be my problem!!!) I have created the database using the same name and the user with the same name on the new server. The only difference with connection string is localhost rather than fixed IP Address on live server.
I uploaded backed up database to the new server so I had recent data to use. I then changed Database details in php runner and then published the project via ftp from within php runner having created the new ftp details for the test environment.
This all worked fine.
I then made changes to the tables within the test environment (from inside php runner) and syncronised. I then made changes to various views etc and then published. When I went to view, I got errors complaining that columns could not be found (the 2 I added). When I done some digging around, the changes I applied to the database had changed the table on the LIVE environment and not the test environment. Therefore, when it sync'd it somehow sync'd to the LIVE system and not the test. I then download the entire test site and done a search through all files for the IP address as this was unique to the live system. Nothing was found.
Help!!! I am not prepared to make any more changes until I can resolve this. It may be something very simple but I have spent ages looking so could be missing the obvious.
Many thanks in anticipation
Andrew

Sergey Kornilov admin 10/3/2013

There are a few things that are confusing me here. If I understand it right you expect your PHPRunner project point to your test environment while it points to the live environment. If this is correct you need to proceed to Database connection screen in PHPRunner and make sure that it points to your test environment.
So I'm also not sure I understand if localhost is the address of your test or of your live system. Probably you need to post all details of your test and of your live environment (except passwords) as well as a screenshot of your database connection screen (wipe out password as well).

A
Andrew S author 10/4/2013

Apologies for confusion.
Live Site- Output Button


Database Connection - LIVE site


Test Site- Output Button


Database Connection - TEST site


On 1st October, data was extracted from LIVE site and imported on Test site. Therefore last record dated 1st October.
Here is screenshot of data from the TEST site as it is NOW (4th October) using phpMyAdmin which is correct i.e. last entry as it was when I did the import.


However, if I use the Query button in php runner and look at workorders results, this is what I get


The is the LIVE database data as can be seen by date field as well as work order number.
The change to the table I made in TEST environment was initially adding 2 columns as marked below


This change is NOT applied in the TEST environment but IS applied to the LIVE environment when sync'd. WHY?????????
When I attempt to login to the TEST environment (which I have made very clear on login screen below)


I now get the following error


And when I login to the LIVE site - different url, different server everything is fine


Sorry for being long winded but hopefully this will show you the problem.
To clarify ..... Modifying tables in TEST environment (localhost)are applied to LIVE environment (IP Address) when sync'd not the TEST environment.
Regards

Andrew

Sergey Kornilov admin 10/4/2013

Andrew,
you are confusing a few things here. The question that I have asked and, apparently, the database connection that PHPRunner uses is setup on 'Database connection' screen. You are posting screenshots of the Output directory which is irrelevant here.
To get to 'Database connection' screen in existing project proceed to 'Tables' screen and then click '<<' button on navigation toolbar.

A
Andrew S author 10/4/2013

Thanks so much. Yes I was confusing things and did not know about that connection screen - I thought I just had to change at the Output database connection screen.

Lesson learnt without any damage being caused to live system.
Thank you once again.
Andrew