If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > php access to mySQL db in different folder?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-04, 17:16
acutair acutair is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
php access to mySQL db in different folder?

hi all,

newbie question ...

i'm running a php interpreter and mySQL for windows on my local machine (xp pro pc). php files located inside my Inetpub/wwwroot folder run fine, so i assume the interpreter has been folded into IIS somehow. with the mySQL server running, i can connect to localhost.

problem is, i created a test database from the mySQL command prompt, so it lives (by default) in the mysql/data folder. i'd like to access the mySQL database via my php scripts, regardless of where those two files reside.

i tried to google my way through this, but nothing so far. if you've got any hints, i'd be into hearing.

thanks!

andré
Reply With Quote
  #2 (permalink)  
Old 06-08-04, 17:21
Strikerz95 Strikerz95 is offline
Registered User
 
Join Date: May 2004
Posts: 28
You basically need to create the database as a server object within you PHP scripts so you can draw information from it. This is a really common need so I am suprised you couldn't find what you need on google. I use ASP so I don't know the command sequences off the top of my head. http://hotscripts.com has alot of PHP database tools that will work with MySQL. Take a look through those and see if you can find what you need.
Reply With Quote
  #3 (permalink)  
Old 06-09-04, 11:08
acutair acutair is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
thanks for the reply.

yeah, in ASP you'd just define the path as part of the connection string:

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/database/myDatabase.mdb"

i guess i was looking for an analog in the PHP world. there're plenty of tutorials that talk about how to install the php and mySQL clients, and how to use php to connect to the mySQL server (and thence to the database). just nothing that talks about getting the php client to see databases that live in other folders.

i'll keep googling.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On