I would like to connect to a database with an external ip of the pc on which the server, for example:
<? $db_host = "xxx.xxx.xxx.xxx" //external ip
$db_user = "user"; $db_password = "password"; $db_database = "database";
$conn = "mysql:host=$db_host;dbname=$db_database;charset=utf8mb4"; try {$db = new PDO($conn , "$db_user", "$db_password");}catch(PDOException $e) {echo 'Error: '.$e->getMessage();}?>
So, can you do that? And if so, how can I do it? Thanks everyone for help;)
P.s: Sorry for my bad English