Jump to content

Search the Community

Showing results for tags 'php_network_getaddresses'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. <?php $db_local_host = 'localhost'; $db_local_user = 'root'; $db_local_password = ''; $db_local_db = 'my_localdb'; $db_local_table = 'my_maintable'; $db_remote_host = 'http://www.mydomain.net/'; $db_remote_user = 'mydomain_admin'; $db_remote_password = 'mydomain_passwd'; $db_remote_db = mydomain_db'; $db_remote_table = 'my_maintable'; $dump = shell_exec("mysqldump -u{$db_local_user} -p{$db_local_password} --no-create-info --compact {$db_local_db} {$db_local_table}"); echo "Connecting to remote db...\n"; $link = mysql_connect($db_remote_host, $db_remote_user, $db_remote_password); if (!$link) { die('Could not connect to remote db: ' . mysql_error()); } echo "Connected successfully\n"; if (!mysql_select_db($db_remote_db, $link)) { die ("Can't connect to db {$db_remote_db}" . mysql_error()); } echo "Connected to db {$db_remote_db}\n"; $sql = "TRUNCATE TABLE {$db_remote_table}"; echo "Running query: {$sql}\n"; $res = mysql_query($sql) OR die(mysql_error()); echo $res ? "success\n": "failed\n"; echo "Running dump query\n"; $dump = str_replace("INSERT INTO `{$db_local_table}` ", "INSERT INTO `{$db_remote_table}` ", $dump); $dumps = explode("\n", $dump); $res = null; foreach ($dumps as $dump) { $dump = trim($dump); if($dump){ $res = mysql_query($dump) OR die(mysql_error()); } } $res = mysql_query($dump) OR die(mysql_error()); echo $res ? "success\n": "failed\n"; mysql_close($link); ?>
×
×
  • 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.