Bootstrap table showing JSON data

前端 未结 3 566
耶瑟儿~
耶瑟儿~ 2021-01-16 05:14

I\'m running Bootstrap on my site, combined with a bootstrap plugin called Bootstrap Tables. It requests the data to be delivered as a JSON file.

I\'m having trouble

3条回答
  •  深忆病人
    2021-01-16 05:36

    Solution:

    My .json files weren't proper array's. Use the following code to make a working JSON file:

    num_rows > 0) {
        while ($row = mysqli_fetch_assoc($result)) {
            $json[]=$row;
        }
    }
    
    // CLOSE CONNECTION
    mysqli_close($dbConnection);
    
    echo json_encode($json);
    ?>
    

提交回复
热议问题