如何在php中将本地服务器连接到实时服务器mysql数据库

Is it possible like connect the local server to the live server database .and fetch the data from that live server database table like users and that users's table's data insert into local server's db.is it possible to connect live server from local server.

Yes, you can. You can use live credentials to connect to live database. For Example:

$server = "Live Hostname or Live Server IP Address";
$username   = "root";
$password   = "password";
$database   ="dbname";


$con = new mysqli($server,$username,$password,$database);
if (!$con){
die('Could not connect: ' . mysqli_connect_error($con));
}