PDA

View Full Version : Database access from different locations


chinni
04-06-2003, 09:53 PM
hello everybody,

My database is housed in a directory say "CHAMPION".Now, i copied this directory contents to a different location say "FORMULA1".

The formula1 directory does'nt have the database.

Is it possible to display the contents of this database from the formula1 directory????

(All the directories are in the server).

Or in other words, please clarify the following if I does'nt make any sense above.

In my server, there are 3 directories: "CHAMPION", "FORMULA1", "DRIVERS".

The above 3 directories are for three different webpages.I want to share one database to all these three.Where should i place my database???Right now, my database is placed in the "CHAMPION" directory and the champions webpage is working fine.I want "FORMULA1" and "DRIVERS" webpages also to access the same database.

How can i proceed with this one???

Thanks in advance.

raf
04-06-2003, 10:18 PM
chinni,

not wanna put you down or anything, but be sure that you know what you're doing before prodeeding.

now. what sort a db? wat sort a scripting language are you using?

If you work with, say Access as a db and you make a DSN-less connection, then you need to specify the path. Its best that you always store your db's in a different folder then the script-pages. a folder like medatabases or whatever.
Then, store your connectionstrings in a server side include (SSI). The path should start at the virtual root. This way, it doesn't matter were the script (that cantains the SSI) is located. You could even use the same SSI for all your apps.

If you work with a MySQL db (a db wich is controled by a virtual dataserver) then you just need to specify the machine where this db is stored (the dataserver does the rest)
(kinda like if you'de use a DSN for Access)

chinni
04-06-2003, 11:03 PM
HI raf,

Well, i aint sure if you understood my problem or if i'm not clear.
Mysql is the database and PHP is the language i'm using.

Lemme explain you in detail what i'm asking here.

In one of my server, i've got 3 directories namely - champions, formula1, drivers.

each directory is designated as a webpage.

something like:

www.myname.com/champions/index.php
www.myname.com/formual1/index.php
www.myname.com/drivers/index.php

Now, I've a database which is placed in the champions directory.so, all the data which I need for the champions homepage is fetched from this database.I also want to use the same database for other webpages, formula1 and drivers.
Is that possible if I house the database in the champions directory????or should i place the database outside these 3 directories????

Thanks everybody.

raf
04-07-2003, 08:26 AM
you should place it outside these sites. Group all db-s and files you need writepermission on to run the site in one directory.
That's what i do, and what most hosts will do/recommend for smaller sites or free accounts.