Forum Moderators: coopster

Message Too Old, No Replies

DB connection info stored in another DB?

About using info from one db to create a session on another

         

rgilbank

10:38 pm on Jun 16, 2008 (gmt 0)

10+ Year Member



Hi guys,
I'm relatively new (though I like to think I'm not a complete noob) to PHP/MYSQL. Here's my question. I'm looking to get into reselling web hosting a little bit, based on a hosting plan I already own (they say it's fine). I have access to unlimited databases and would like to dedicate one to each site I host for billing uses and of course the content on their actual sites. We'll call this the user's "private" db.

I've been working with a starter script found at [evolt.org...] . Basically my plan is for clients to be able to enter login information, which would then draw their corresponding private db information from a "master" db full of login information for all the private dbs. The script would then create a session with that information, after it connected to their private DB.

I hope this makes sense, it's a little difficult to explain. Does anybody have any ideas for a general procedure in which I could do this? Or is there a much easier, better solution available? Thanks!

d40sithui

7:07 pm on Jun 17, 2008 (gmt 0)

10+ Year Member



instead of something like this.
$link = mysql_connect('localhost', 'username', 'password);

you could use this to connect to another website's db
$link = mysql_connect('www.yourwebsite.com', 'username', 'password);

so first the user would log into the "master" db to verify accont and retrieve info. then you can use that info to connect to another db. havent tried this myself, but it seems logical.