Database access

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
minds_gifts
Forum Commoner
Posts: 63
Joined: Mon Feb 10, 2003 4:23 am

Database access

Post by minds_gifts »

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.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Do you have phpMyAdmin? And which database are you using? I presume MySQL, so if you download and unzip phpMyAdmin in your server, you can have very easy management of all your databases.

Try it. :)
minds_gifts
Forum Commoner
Posts: 63
Joined: Mon Feb 10, 2003 4:23 am

Post by minds_gifts »

hello oromian,

I guess, you understood me wrong.I got phpmyadmin.My question was something different.

Any other ideas please
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I guess, you understood me wrong...My question was something different.
Your question is a bit confusing and you don't mention at all which database you are using. I'm going to try and answer too but am not at all sure that I've understood either. If I've got it wrong too - maybe you could reword it to make it clearer for us?

Firstly MySQL's data files should not be in your web root - by that I mean they really shouldn't be in a folder which is accessible via the URL. Normally they are in the mysql/data folder.

Secondly - the database files do not have to be and (once more with feeling) should not be in the same folder as the scripts which access them.

Thirdly - you should be able to connect to the MySQL database from any of your directories, have you tried it using the same connection information you used previously?

Mac
Post Reply