Web Hosting Talk







View Full Version : MySQL Database Help


proathlete03
03-30-2010, 03:02 AM
I've got a PHP script (program) that was made for our company and I'd like to resell it. Currently all tables are locked to one user, but I'd like to be able to set it up so multiple people can use the program but their data is safe and separated, Currently if I were to create additional users, all of their data would be visible to one another. I could, however, create a new database for each user but this is very tiresome. What would you all recommend???

bear
03-30-2010, 08:06 AM
Did the agreement with the developer include reselling the script created for your company? There are usually restrictions on it being used only for the site/purpose that it was intended designed for.
From the sound of it, you're trying to set this up to be SAAS (software as a service)? Perhaps the original developer could help. You should consider involving him and offering a percentage, as that would give you someone that knows how to do the coding, and so on.

mattle
03-30-2010, 09:23 AM
It really depends on the application. You may want to create a whole new database for each client. That would certainly make things easier down the road if you want to distribute your clients across multiple database servers. Otherwise, if you mix client data in the same tables, then the access restrictions must be done via programming.

But, bear brings up a very important point. Depending on your local laws and the terms of the agreement with your original developer(s), you may not hold the intellectual property rights that you think you do. If you think you're going to make a significant amount of money selling this app, it's worth the few hundred dollars up front to have an intellectual property lawyer review everything. If your new plans for the application are beyond the scope of the original terms, draw up a new agreement between yourself and the application developers. You don't want to make a million dollars and lose half of it in a lawsuit later.

proathlete03
03-31-2010, 02:22 AM
Did the agreement with the developer include reselling the script created for your company? There are usually restrictions on it being used only for the site/purpose that it was intended designed for.
From the sound of it, you're trying to set this up to be SAAS (software as a service)? Perhaps the original developer could help. You should consider involving him and offering a percentage, as that would give you someone that knows how to do the coding, and so on.

We have full rights to the product(s), including one patent and several copyrights and trademarks.

How difficult is it to convert a script / database from a single user / single database to a SAAS that can be resold to multiple people? The most difficult thing is separating data so if one user logs on another user cannot access their data.

Take for example a mailing program we have - each client would need their own lists, customers etc. The way it is set up now anyone who logs in has access to everything - I would want to set it up so each customer has their own data. How tough is it to reprogram everything to do that?

tim2718281
03-31-2010, 08:14 AM
How difficult is it to convert a script / database from a single user / single database to a SAAS that can be resold to multiple people? The most difficult thing is separating data so if one user logs on another user cannot access their data.

Do you mean each customer is going to receive a copy of the script and install it on their own system?

If that's the case, there's no possibility of users accessing each other's data. Supply a copy of the script to someone, have them install it and get it running, and report to you any problems they found and what they had to do to fix them.

Or do you mean you will be running the script on your own server, and will provide the use of it there to your customers.

If that's the case, it depends how the script was developed. Ideally, it should have all its database access parameters somewhere they can be modified for each user - typically, there will be a file called "config.xxx" or "database.xxx". Again, provide someone with access to the script and have them report any problems.

Bear in mind that if you're supplying the program to others, you become liable to them for the consequences of any negligence. For example, if it does not guard against SQL injection, that could cost you money. So as well as testing the installation processes, you should ensure it has been tested for security vulnerabilities, and keep a copy of the test results.

mattle
03-31-2010, 09:50 AM
We have full rights to the product(s), including one patent and several copyrights and trademarks.

How difficult is it to convert a script / database from a single user / single database to a SAAS that can be resold to multiple people? The most difficult thing is separating data so if one user logs on another user cannot access their data.

Take for example a mailing program we have - each client would need their own lists, customers etc. The way it is set up now anyone who logs in has access to everything - I would want to set it up so each customer has their own data. How tough is it to reprogram everything to do that?

The easiest way would be to have a different database for each client. Then, they'd be tied to that schema name upon log in and all subsequent database queries would be done specifically against their own exclusive set of data. You can make things even simpler if you have a separate installation of the software for each client as well--then each install just needs a unique config file with db connection info.

The alternative is to basically devise a system to tag every piece of data with an owner account and then perform a permission check on every db read in the code.

I would personally opt for the first option. Easier to get going and much more portable if your resource needs outgrow your current hardware.