fer0an Posted October 20, 2010 Share Posted October 20, 2010 hello My database is in a same server with seperate domain name , then I want to insert from website1 mysql database on website2 mysql database. can anyone help me? Link to comment https://forums.phpfreaks.com/topic/216354-insert-data-from-one-website-to-another-website/ Share on other sites More sharing options...
fer0an Posted October 20, 2010 Author Share Posted October 20, 2010 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: Link to comment https://forums.phpfreaks.com/topic/216354-insert-data-from-one-website-to-another-website/#findComment-1124324 Share on other sites More sharing options...
fenway Posted October 23, 2010 Share Posted October 23, 2010 That's purely a connection issue... probably temporary. Link to comment https://forums.phpfreaks.com/topic/216354-insert-data-from-one-website-to-another-website/#findComment-1125629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.