w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to connect online mysql database server from local wamp server using php?

To connect to remote server from your local machine you need some already granted privileges on that server itself with your IP and an username with a prespecified password. So you can't do it without their permission.

Check this answer

After that you are allowed to create connection to that remote database server using the following syntax:

$hostname='www.facebook.com';// Remote database server Domain
name.
$username='username';// as specified in the GRANT command at that server.
$password='password';// as specified in the GRANT command at that server.
$dbname='testdb';// Database name at the database server.
$mysqli = new mysqli($hostname, $username, $password, $dbname);




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.