我正在尝试获取图像表单数据库的文件名,并希望插入到页面中。我正在将图像插入本地文件夹并将名称存储在数据库中。需要找回它。

            <?php
            global $DBConnect;
            $Query = "SELECT * FROM posts ORDER BY datetime DESC ";
            $Execute = mysqli_query($DBConnect,$Query);

            while ($DataRows = mysqli_fetch_array($Execute)){
                $PostID = $DataRows["id"];
                $DateTime = $DataRows["datetime"];
                $Category = $DataRows["category"];
                $Author = ["author"];
                $Image = ["image"];
                $Post = $DataRows["post"];
            ?>
           <div class="thumbnail">
               <img src="uploads/<?php echo $Image;?>">
           </div>
            <?php }?>

最佳答案

我没有使用$DataRows获取图像。这是我的错。。!

$Image = $DataRows["image"];

09-27 04:11