所以我有一个任务管理器需要从数据库中提取数据。每个任务还需要显示一个带有详细信息的模态。其中有一张带有标记的地图。这就是我的问题所在。我的模态的本质是每个任务都有自己的模态。因此,这意味着地图必须在每个模态上具有不同的 id。
<?php
$sql = "SELECT * FROM tasks";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$id = $row["id"];
$task_name = $row["task_name"];
$client_id = $row["client_id"];
$priority = $row["priority"];
$description = $row["description"];
$assigned_to = $row["assigned_to"];
$start_date = $row["start_date"];
$due_date = $row["due_date"];
$lat = "-26.722804"; //this will need to change once i've figured out the $id issue
$lng = "27.088537";
?>
脚本似乎只识别被调用的最后一个 id,而不是遍历每个 id。这意味着只有 id 的模态映射才会起作用。我如何让它为每个 ID 而不仅仅是最后一个运行脚本?
浮云间
相关分类