Why do you need a full private database for ‘each’ user?
The way to do that is to create a new database user for each new user that you need, and grant them permissions over only the tables that they need to have access to. Then you run whatever queires are needed with that database using that database user, and they won’t be allowed to access anything that they are not authorised to see.
Thank you catacaustic,, im gonna give it a shot
@ Spence “the evil genius” forman, my website will have a database, to hold personal private info for each user that joins. (hopefully millions) the users are responsible for imputing their information. and they have their own private area where the database table will be
I don’t want to create a new database for each users that joins if I dont have to. I also don’t want to create a new user every time someone joins.
Ideally I would like to create one blank database and when a user joins, he or she, gets a blank database for them to start populating.
it will be in their own private area of course
I don’t want to create a new database for each users that joins
I would like to create one blank database and when a user joins, he or she, gets a blank database for them to start populating
Those statements together just don’t make sense. You can’t give someone a blank database, but not create a database for them. I don’t think you mean that quite the way that you said it, so I’ll try to work with what you’re really looking for.
Without knowing exactly what you want to end up with, you have two choices:
First, create a new table for each user when they join,login, are approved. This will let them have their own “blank slate” so to speak. The only hard part about this is keeping track of the table names, but you can use user ID’s to work with that, so it’s not too hard to do.
Second, you could create a single table, and have a foreign key set up so that each record in that table is attributed to a user. Personally I’d dol it this way as having many tables can make the database slow, and will cetainly make it a lot harder to manage. It also can be just as fast if you get the indexes right which isn’t that hard. All you need ot do is get your queries to work with only records that are set for that user, so that’s one extra line in a WHERE
clause.
Thanks again, catacaustic,, let me give that a shot…
@ catacaustic,, I haven’t tried it yet, but last night I thought it would be so much easier to manage, in this particular situation, to use a spreadsheet, if wordpress would allow front end editing ?
Not really. If you can find a way to integrate a spreadsheet into your site, maybe it would be OK, but then you’d still need to create a new spreadsheet for every new user. Also, spreadsheets don’t offer the same sort of functionality and security that a decent PHP-MySQL system does where you can make sure that the users can only do what they are allowed to do.
What I suggest is that after 5 days of thinking about this, just go and try it. Put something together and see how it works,. If it does what you want, keep going with it. If it doesn’t, learn from that and try something else. The only way to see if any solution is going ot suit you is to actually try it for yourself.
Man,, thanks, dude,,, I agree