这是我的代码如何获取:(代码在JavaScript中)
function getPoints() {
return [
<?php
$sql = "SELECT firstname, lastname, FROM test";
$result = mysqli_query($connect, $sql);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo "new google.maps.LatLng(".$row["firstname"].", ".$row["lastname"]."),";
}
$connect->close();
?>
];
}
问题是,它没有显示任何内容。