Jump to content

Recommended Posts

I am making a php script that will copy all the tables from a database on host A and copying them to another database on host A or on host B (depending on the users selections).

 

I want to allow the user to select whether or not they want the "structure and data" or just the "structure" copied.

 

What is the best way to do this?

Link to comment
https://forums.phpfreaks.com/topic/219242-coping-a-database/
Share on other sites

We need some more information regarding what you are trying to achieve. You can use HeidiSQL if you want to transfer data manually from remote host to remote host or MySQL supports Replication if you want data to be always copied from one database to another.

Link to comment
https://forums.phpfreaks.com/topic/219242-coping-a-database/#findComment-1137606
Share on other sites

I am working on a project, and I have a database administration page. Currently on this page you can change the connection settings (host, username, password, database) from 4 text fields.

 

The second section (see attachment), is a "database copier", and the section pertaining to this question. In this section the user enters in the "host", "username", "password", and "database" of where the current database will be copied to. They also choose if they want the structure and data of all the tables copied, or just the structure of all the tables copied. Next they press "Copy" and it copies it all to the new database!

 

I am not sure what is the best way to copy, or even how to copy the database, so that is basically my question. How, and what way should I do this?

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/219242-coping-a-database/#findComment-1137641
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

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.