views:

97

answers:

5

I'm working with a programmer who doesn't want me touching his database...

I would like work with a database instead of hard coding my content but don't want the sites performance to suffer.

Is it bad practice to query two different databases on one page?

If its not a problem is there a limit to how many databases you can query per page?

PS the site is php/mysql

+4  A: 

me touching his database

That's probably because there is a layered architecture in place and you're not supposed to be talking to the database directly.

Otherwise, if you've come already to the division - "my" database, "his" markup, it's a recipe for disaster.

Is it bad practice to query two different databases on one page?

No, if there is a real need to do it. Yes, if only because somebody declared the database their property and you've got to have your own.

Developer Art
Unfortunately it is a "my database" "his markup" scenario. Darn politics.
chris
+1  A: 

No its not a problem, in some scenarios it's even a pretty good approach.

code_burgar
A: 

i routinely hit a estimate database and a reference database aka customer live in texas, closest office is 150 miles away.

Christopher Kelly
+1  A: 

It depends on if the databases are holding related data. If they are related, it makes sense to keep them in once database. The programmer could then give you a user account with limited access so that you can't corrupt other things.

There is some cost to making a new connection, but it will likely be negligible if you are doing a number of queries.

unholysampler
I don't know how his db is structured but i guess ill be working on my own if its not a problem :)
chris
+1  A: 

Can you have a separate schema in his DB? If so, then you could save some connection building /destruction time.

Will you be storing data/relational data in the DB? If not, can you get away with include("file.php")

All that being said it's not a bad practice to have multiple DBs on a page you just need a good reason to do it.

easement