define('HOST','*****');
define('USER','*****');
define('PASS','*****');
define('DB','*****');
$con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect');
if($_SERVER['REQUEST_METHOD']=='GET') {
$user = $_GET['user'];
$sql = "SELECT * FROM sample WHERE user='".$user."'";
$result = mysqli_query($con,$sql);
while($row=mysqli_fetch_assoc($result)) {
$output[]=$row;
}
print(json_encode($output));
mysqli_close($con);
这是我的php代码,它只返回与该值匹配的单个记录。但我希望返回与给定值匹配的所有记录。