Jump to content

Recommended Posts

Posted

I would like to create a database per (registered) user with multiple tables.

 

Can I automate this process by creating the database via php?

 

The databases created with cpanel have my username prefixed.

 

Is this a function of cpanel? or something else behind the scenes?.

 

If i am able to create databases via php, should i create the database with or without the prefix within my code?

 

If this sounds like a bad idea, or if I'm monkeying with things that shouldn't be monkeyed with let me know. :)

Posted

Welcome to the forums :)

 

You can't easily create a database from a php script - you need to go into cpanel to create it.

 

All of your databases need to have your cpanel username as a prefix, so yes you do need it.

 

I'm always worried slightly about automatically creating things by any (even registered) user. Simply because of the security issues it opens up. It does depend on what you want to actually do of course, and how secure your script is. If we were to take a worse case example of email accounts - then you could enable a spammer to do their nasty work - and it's your whole account that then gets suspended (and the spammer won't care, they will just move on). There are automatic scripts you can do securely :) but they just need to be checked, hence my slight note of warning ;)

Posted

Welcome to the forums! I agree with Andy on this one. While it would make your life easier, it could also potentially make the life of someone with evil tendencies easier too! :)

Posted

Is there any specific reason why you wanted to use this method for newly registered users? SQL storage is generally very flexible. I can probably help you come up with a better solution.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...