php - How to remove Warning: mysqli_connect(): (HY000/2002)? -
warning: mysqli_connect(): (hy000/2002): connection attempt failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond. in c:\xampp\htdocs\phpfiles\phpfile.php on line 2
my code ok...php connects local host not remote server...remote database on xamp think
microsoft windows 10
<?php $con=mysqli_connect("192.168.1.1","cykiqdbuser","pass","cykiqdb"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select * cy_bikes_log"); echo "<table border='1'> <tr> <th>id</th> <th>dock id</th> <th>status</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['id'] . "</td>"; echo "<td>" . $row['dock_id'] . "</td>"; echo "<td>" . $row['status'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?>
i can login php admin online mean database online??
check db details may occur due putting correct detail in connection $connection = mysqli_connect($mysqlserver, $mysqluser, $mysqlpass, $mysqldb);
Comments
Post a Comment