PHP Localhost Application connect to server database
- by Cross Vander
I want to ask about how to connect my localhost application (C:xampp/htdocs/myproject) to database at my server host (www.someweb.somedomain)?
Am I possible to do that? If it is, how to connect it at my php config? Right now my config (server.php) is:
<?php
    $host = "my web IP public:3306";
    $user = "root";
    $pass = "";
    $db = "dispatcherDB";
    $conn = mysql_connect($host, $user, $pass) or die ("Cant connect to mySQL");
    mysql_select_db($db);
?>
what I got:
  Warning: mysql_connect(): No connection could be made because the target machine actively refused it. in C:\xampp\htdocs\XMS\server.php on line 7
So, what must I filled for $host? I'm trying using website IP, it still can't connect. Maybe there's someone here have experience at this problem?
Sorry for my bad English