</...</desc><code><?php $servername = "localhost"; $username = "root"; $password = "*****"; $dbname = "basi"; $features = array(); $geojson = array( 'type' => 'FeatureCollection', 'features' => $features ); $i=1.01; $conn = new mysqli($servername, $username, $password, $dbname); // Parse the query into geojson // ================================================ // ================================================ // Return polygons as GeoJSON for($i;$i<10;$i++){ $k=floor($i); $sql = "SELECT x1, y1 FROM afriti where floor(id)=$k"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $feature = array( 'type' => 'Feature', 'geometry' => array( 'type' => 'Polygon', 'coordinates' => array((float)$row["x1"], (float)$row["y1"]) )); array_push($features, $feature); } } } echo json_encode($geojson); ?> </code><question vote="0"> <p>我只是在完成Ajax后才打印某些东西,并且它不会输出任何内容,因此它没有结束,要么写不好写东西。 </p>它没有打印任何错误消息。 <pre> </pre> <p>对于初学者,您缺少括号</p><code>)</code><pre>在此行中:</pre> <p><code>'coordinates' => array((float)$row["x1"], (float)$row["y1"])); </code></p> <p> </p></question>

问题描述 投票:0回答:0
php mysql ajax leaflet geojson
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.