📌  相关文章
📜  如何使用php代码示例将mysql数据库中的数据显示到html表中

📅  最后修改于: 2022-03-11 14:54:15.032000             🧑  作者: Mango

代码示例2

        ';  //initialize table tag
while ($property = mysqli_fetch_field($result)) {
    echo '' . $property->name . '';  //get field name for header
    array_push($all_property, $property->name);  //save those to array
}
echo ''; //end tr tag

//showing all data
while ($row = mysqli_fetch_array($result)) {
    echo "";
    foreach ($all_property as $item) {
        echo '' . $row[$item] . ''; //get items using property value
    }
    echo '';
}
echo "";
?>