0
$server_net=mysql_connect("xxx.xxx.170.54","net_db","dbpass") or die("SQL server error..!");
@mysql_select_db("net_db",$server_net) or die("database error..");
#------------------------------------------------------------------
$server_local=mysql_connect("localhost","","") or die("SQL server error.!");
@mysql_select_db("local_db") or die("Database error..");



mysql_query("DROP TABLE IF EXISTS net_db.komisyon",$server_net);
mysql_query("CREATE TABLE net_db.komisyon SELECT * FROM local_db.komisyon");

How can I copy table from local to net ?? I want to create table on server like local table. When I run this query give error (Unknown database)

0

1 Answer 1

2

You're sending the CREATE TABLE command to your network server, but it doesn't have any connection to the local_db database.

You must either export the data from your local database in some manner (probably best to use mysqldump, although you could also load it into PHP and then INSERT into your network database), or else look into MySQL replication or clustering to keep the databases synchronised.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.