This topic is locked

Database Connection

9/2/2010 10:33:54 AM
PHPRunner General questions
r.altendorfer@suzuki.at author

Hello to all of you <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=15139&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />
After hours of searching this board and the www - without usable result <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=15139&image=2&table=forumtopics' class='bbc_emoticon' alt=':unsure:' /> - I hope someone here can help me.
I´m building an intranet website for our business with PHPRunner 5.2, connecting to MSSQL server, external XAMPP Webserver.

Is there a possibility to connect to 2 different databases at the same time(on the same server)?

f.e. in dbcommon.php I use the following connection:

$host="server";

$user="username";

$pwd="password";

$dbname="db1"

So, can I connect to second database "db2" at the same time, too??
Thanks a lot to everyone, hope you have an answer for me <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=15139&image=3&table=forumtopics' class='bbc_emoticon' alt=':P' />

Greetings from Austria!!

Admin 9/2/2010

It's not possible in PHPRunner wizard however you can do that using events.
You need to provide more info on what you need to do with second database so we can provide a better advice.

r.altendorfer@suzuki.at author 9/3/2010

Dear Sergey,
at first let me thank you for your quick reply <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52384&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> !!
The situation is as follows:

On db1 are about 5 tables (named COC, NAT, MUSTER,...) which contain technical data for cars.

On db2 there are 2 tables, one containing custumer data, the other sales and financial data.

There is at least on key column that refers to all these tables (in db1 and db2), which is VIN (the vehicle identification number, stupidly named FIN in db1 and VIN in db2 <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52384&image=2&table=forumreplies' class='bbc_emoticon' alt=':(' /> ).

What I have to do is to combine the technical and the sales data to build a kind of "vehicle master file", where our users can see and search the data.

f.e.: one knows a VIN and needs to see not only some technical data (like length, width, weight) but also sales data of this vehicle (how bought the car? adress of customer? dealer who sold it?...)

So, all I have to do are SELECTs, there won´t be any INSERT, UPDATE or DELETE so far...

As I said earlier, the databases are both on the same MSSQL Server Version 8.0.2055
I hope this is enough information - if not please let me know <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52384&image=3&table=forumreplies' class='bbc_emoticon' alt='B)' /> !!
Yours sincerely,

Rob

Admin 9/3/2010

Rob,
the best approach would be create a set of views in your first database for each of tables in second database. Then you can add those views to PHPRunner project and use them the same way as normal tables.
This approach is not elegant but it works.

Create View Database2TableX as

select * from Database2.dbo.TableX
T
tedwilder 9/11/2010



Rob,
the best approach would be create a set of views in your first database for each of tables in second database. Then you can add those views to PHPRunner project and use them the same way as normal tables.
This approach is not elegant but it works.

Create View Database2TableX as

select * from Database2.dbo.TableX



Hello

I do have the exact same problem : We have a database on oracle with user names , adresse, phone etc.

But I need with php runner to do a website to create order for thoses users. I do not have admin rights on the oracle base ( of course I can ask the admin to do some setup the first time but after that I wont be able to modify anything).
The database on oracle is updated almost everyday, so on my phprunner mysql server I would need the autofill on beford record to place order to reflect changes made on the oracle base. ( well it can be not real time but at least one time per night some kind of synchronisation or something with a cron job.. maybe creating a new view.. i don't know..)

all I want to do is to use names/user numbers from oracle base to my own mysql base for creating my orders. if you have any idea..

thank you.

Admin 9/12/2010

tedwilder,
you'll need to run some kind of cron job that will import data from Oracle into MySQL on timely basis i.e. nightly.