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

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

-------------Problems Reply------------

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.

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

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.

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.

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

Category:php Views:0 Time:2010-03-10

Related post

  • Best practice to query the performance state of the mongo 2012-04-29

    I'm interested in the best practice to query the performance state of the mongo cluster (on mongohq) using a ruby script. I would like to build some ruby script that checks if the mongo is idle (or near idle) and if so, start to do some work (lots of

  • What's quicker; including another file or querying a MySQL database in PHP? 2008-10-03

    In PHP, which is quicker; using include('somefile.php') or querying a MySQL database with a simple SELECT query to get the same information? For example, say you had a JavaScript autocomplete search field which needed 3,000 terms to match against. Is

  • Best Practices for Processing Errors from Database in CodeIgniter 2009-04-09

    I have a table with a unique key (date + userid) in my web application database. When I try to insert record with existing date and userid I receive the following error: dupicate key in table I turned on the database debugger in application config, b

  • SQL Server query to create database is giving me an error when I include numeric characters in the database name 2010-06-21

    I am having trouble running a simple sql query in Microsoft SQL Server 2005 to create a database and im not sure why. When I run this query CREATE DATABASE 4444-virtual2 I receive this error Incorrect syntax near '4444'. Is there anything in particul

  • Remove all query strings from requests for particular page 2009-02-12

    I have a flex application that for some reason I do not know why, when you are using google chrome and access the page with any query strings in the URL the applications behaves unexpectedly. The page does not need query strings though. But many thin

  • Executing Access SQL Query Between Two Databases 2009-11-03

    I need to execute a SQL Query between two databases. Example: SELECT * from table1 in 'D:\paulo\sdatabases\SCWa.mdb' The problem is that both tables have a password. How can i put the password in a query like this? --------------Solutions------------

  • What is the best way to connect to and query a MySQL database using PHP? 2009-11-17

    This is a pretty easy question but I would like some clarity on something. I have seen a number of different ways to connect and query a MySql Database using PHP but which is the best way to connect and create a query using php ? Hope this makes sens

  • Execute one MySQL query on multiple databases 2010-08-25

    I have a simple question that keeps me up all night :( . Suppose we have 2 databases on different servers. You can easily create 2 connections and manipulate data in both databases. What if I want to execute one query on both databases? Example : INS

  • Excel VBA: Query a MySQL Database 2010-11-29

    I am looking for an example of how to query a MySQL database using Excel VBA. I am able to use Data \ From Other Sources \ From Microsoft Query to import data from the db, but what I am actually looking for is a way not to import it to a spreadsheet

  • SQLite Query returning entire database 2010-12-18

    First of all, I'm using C#, as well as the C# wrapper for SQLite. I am attempting to query my SQLite database using the following code, but it continually returns the entire database instead of what is expected. I am extremely new to sql queries, so

  • Using Lucene to query an RDBMS database 2011-01-17

    I've skimmed the docs for the Java version of Lucene, but I can't really see the top-level "this is how it works" info so far (I'm aware I need to RTFM, I just can't see the wood for the trees). I understand Lucene uses search indexes to return resul

  • How to query huge MySQL databases? 2011-01-22

    I have 2 tables, a purchases table and a users table. Records in the purchases table looks like this: purchase_id | product_ids | customer_id --------------------------------------- 1 | (99)(34)(2) | 3 2 | (45)(3)(74) | 75 Users table looks like this

  • Best practice for creating SQL Server databases for a data warehouse 2011-01-25

    I'm about to create 2 new SQL Server databases for our data warehouse: Datawarehouse - where the data is stored Datawarehouse_Stage - where the ETL is done I'm expecting both databases to be able 30GB and grow about 5GB per year. They probably will n

  • SQLite query for comparing database value and system time 2011-02-12

    I want to compare the value which i already stored in database with current system value. and pls give answer for following question SQLite query for comparing database value and system time --------------Solutions------------- That would be an expre

  • Querying the Contacts Database for phone number and handling multiple numbers 2011-02-27

    I want to query the Contacts Database for phone number and if the selected contact has multiple numbers, I display the available numbers for the user to select one of them. I have code in place that would pick up the default number of the selected co

  • What's the standard practice to upgrade a sqlite database from .NET code in an installer 2011-03-16

    I have a .NET application that uses a sqlite database. In the latest release we need to upgrade the schema. I am wondering what is the standard practice to upgrade a sqlite database from .NET code in an installer? We use Wix with custom actions imple

  • How can I query the mysql database for a variable, if exists create another variable, if not insert? 2011-03-31

    say I have a variable $id = mt_rand(); how can I query the mysql database to see if the variable exists in the row id, if it does exist then change the variable $id, once the variable is unique to all other stored ids, then insert it into the databas

  • what is best practice for integration testing a database driven php? 2011-04-05

    Greetings; I am writing my integration tests so I would like to know what is the best practice for integration testing a database driven php site? Should I add and delete data in setup() and teardown() respectively for every test or should my test da

  • how to use a url to query a remote database for android? 2011-04-18

    I have been stuck at this for hours now. I would like to use a URL to query a remote database in android. Can any1 give me an idea on how to do this? Thanks. --------------Solutions------------- I found a good website to answer this question: http://

Copyright (C), All Rights Reserved.

processed in 0.161 (s). 11 q(s)