【发布时间】:2019-11-06 07:39:34
【问题描述】:
Image is displaying all the fields with data coming from database but in the image field it is saying no file chosen.我正在尝试获取具有特定列的行,例如标题、slug 和图像。但是我无法获取特定 ID 的图像。 所有字段都从数据库中获取数据。但是图像越来越失败。 当前代码如下:-
enter code here
if (isset($_GET['piD'])) {
$piD = $_GET['piD'];
$fetch = $conn->prepare("SELECT * FROM posts WHERE id=?");
$fetch->execute(array($piD));
if ($fetch->rowCount()>0) {
$postRow = $fetch->fetch();
$title = $postRow['title'];
$email = $postRow['email'];
$slug = $postRow['slug'];
$body = $postRow['body'];
$image =$postRow['image'];
}
else
{
header('location:posts.php?no post found');
}
【问题讨论】:
-
尊敬的先生,价值应该是多少?因为我的输入字段中有 value="" 。