View Full Version : get data from only one database
Marcus-Hill
04-04-2008, 04:39 PM
Hi,
I'm have a few PHP/MYSQL based scripts I want to install on one domain as featutres of one site. Each feature requires a members login but if I install all them normaly then they would have to register on each different section.
My question is can I install them all using the same database? I'm thinking if I did this then they would have the same username and password for the all the features. Would this work or not? Is there another way of doing this?
NXArmada
04-04-2008, 08:13 PM
That would require modifications to the PHP scripts.
What scripts are you wanting to install?
Rockonmetal
04-04-2008, 08:22 PM
Details are very important... Also *not stealing the moderators job* but you should really pick better titles.
Ok enough nagging...
Your wanting to have it so that it gets data from different parts of a database. Are you making this for a control panel type system? Because I am making one at the moment as well...
If I could know what *your choice on whether you feel like telling* each database basic function or purpose.
djr33
04-04-2008, 10:04 PM
There are a few different ways of doing this.
1. Just install them separately, and users will have to login/register twice/more. (Not what you want.)
2. Integrate the registration by creating a new script; use the data sent from one registration (maybe on a custom form so it includes all the information) to register the user to all of the services-- but don't actually integrate beyond that.
3. Rewrite the scripts to a degree that they can interact successfully borrowing from the same users table (and perhaps other tables as well), and also using the same sessions. Now, if you're lucky, the login may work across several scripts, as it will be the same domain and same user/pass, so if they use the same variable names in the cookies and/or database and/or sessions, then this may match up, at least if the logins don't have added security like generating a session id based on each login.
4. Alternatively, and perhaps not possible in all cases, you could not integrate the scripts but rather integrate the login so that one login creates a session for each script.
Placing all of the scripts into a single database should not be a problem at all-- I don't know of any scripts that require their own database, and won't allow other tables (so just keep the tables separate using prefixes if needed-- which is supported by many scripts).
Beyond what I've said we'd need more information, but it's pretty clear-- you'll just to just start learning the details of PHP and MySQL (http://php-mysql-tutorial.com is a great place to start), because this is a bigger job (mostly time, not necessarily difficulty) than any member here will likely want to devote (especially for free). It's not that we don't want to help, but this is a big project, or at least may be-- perhaps the scripts in question are rather simple.
Also, if you do choose to just integrate the registration, that's much simpler-- integrating the login is a bit more challenging, and fully integrating the scripts would be very hard. I did something similar for a site of mine-- mostly just building on an existing script and adding some other features to the site, and it was very hard, and I cut some corners in doing so.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.