Jump to content

insert data from one website to another website


fer0an

Recommended Posts

I'm using this codes :

// Connecting, selecting database website 1

$dbuser = "test";
$dbpass = "test";
$dbhost = "localhost";
$dbname = "test";
$con = mysql_connect($dbhost, $dbuser, $dbpass)
   or die('Could not connect: ' . mysql_error());
mysql_select_db($dbname) or die('Could not select database');



// Connecting, selecting database website 2

$dbuser1 = "add";
$dbpass1 = "add";
$dbhost1 = "website2.com";
$dbname1 = "add";
$con1 = mysql_connect($dbhost1, $dbuser1, $dbpass1)
   or die('Could not connect: ' . mysql_error());
mysql_select_db($dbname1) or die('Could not select database');

and I recived an error :

 

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/.... on line 22

Could not connect:

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.