我的public_html / iosdata文件夹中有这两个文件:
这是connect.php
<?php
$dbServer = 'localhost'
$dbUser = 'username'
$dbPass = 'password'
$dbName = 'appdb'
?>
这是service.php
<?php
require("connect.php");
$db = mysqli_connect($dbServer, $dbUser, $dbPass) or die ("Could not connect to mySql");
mysqli_select_db($db, $dbName) or die ("Could not select database");
$query = "select * from users";
$result = mysqli_query($db, $query);
while($row = mysqli_fetch_array($result)) {
$row_set[] = $row;
}
echo trim(json_encode($row_set));
mysqli_close($db);
?>
但是,当我使用此url(https://www.website.com/iosdata/service.php)搜索文件夹时,什么也没加载,为什么?
如果您有任何问题,请告诉我!