This topic is locked

Retrieve Data From Multiple Databases

8/21/2007 8:08:32 PM
PHPRunner General questions
R
run4sbc author

Hey Guys,
I was wondering if you had ever thought about adding the possibilty to access multiple databases from one PHPRunner Project? I love PHPRunner to death, best investment I ever made. It worked great on my site last year.
Now I am getting more and more people wanting to use the site for their information so I'm trying to create a big user database that can fall into other databases for each different event. It would require me to be able to access two databases at a time. I know you can tweak the code and stuff to make it doable, but it would take alot of hard thinking. Before I started I just wanted to make sure it wasn't in the plans for a new build or release?
Thanks for everything, and keep up the good work. 4.1 looks pretty awesome.
Cody

J
Jane 8/22/2007

Cody,
unfortunately there is no support for two and more databases in the current PHPRunner version. Perhaps we'll add this feature in one of the next versions.
I recommend you to connect to another database in the events on the Events tab.

A
alang 8/22/2007

I have asked for this as well. In the meantime the following code called from an event works OK (I guess the login and password need to be valid for both databases:
global $conn, $sys_dbname;
if (!$conn || !mysql_select_db("2nd_database_name",$conn))

{

trigger_error(mysql_error(), E_USER_ERROR);

}
... do stuff with the 2nd database
// restore original database

if (!$conn || !mysql_select_db($sys_dbname,$conn))

{

trigger_error(mysql_error(), E_USER_ERROR);

}