Jump to content

Best way to copy mysql DB structure from template upon new sign up?


msaz87

Recommended Posts

Hey all,

 

I have a site where when a client signs up, it will create a unique MySQL DB for them using a template design I've created. What I'm wondering is what the best way to automate this process might be and whether there's a simple coding process to essentially say copy DBexample's structure with no data into NewClientDB?

 

I can think of a few ways to get this accomplished but none too efficient and any that might make it simple for changing the template later on.

 

Hopefully that makes sense -- any advice is greatly appreciated. Thanks!

Store the creation query string in the admin DB, with a variable for the table name. Then just run the query to create the table with the IF NOT EXISTS parameter to make sure the table name isn't duplicated, or by using some other unique value as the table name.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.