<?php
require "dbCon.php";
$qr = "SELECT * FROM cameras";
$ds = mysqli_query($con, $qr);
$arrCam = array();
while ($row = mysqli_fetch_array($ds)){
//echo $row['name'];
array_push ($arrCam, new DsCam(
$row["id"],
$row["name"],
$row["link"]
));
}
echo json_encode($arrCam);
?>
这是页面上回显的内容:
[{"key":null,"CamName":null,"RTSP":null},{"key":null,"CamName":null,"RTSP":null},{"key":null,"CamName":null,"RTSP":null}]