如何使用本地IP地址而不是localhost

时间:2016-07-16 22:30:48

标签: php mysql localhost

使用我的本地IP地址访问我的数据库mysql服务器

<?php
    $col1='customerID';
    $col2='state';
    $conn = mysqli_connect('localhost','root','');
    $db = mysqli_select_db($conn,'dsuclass_gopi595');
    $sql = "select $col1,$col2 from customers";
    $result = mysqli_query($conn,$sql);
    echo "This is my local ip address 192.168.1.7";

?>