我正在尝试使用rowCount获取输入字段中的行,但是图像失败

Image is displaying all the fields with data coming from database but in the image field it is saying no file chosen.我正在尝试获取具有特定列(例如title,slug和image)的行。但是我无法获取特定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');
}
wondernuaa 回答:我正在尝试使用rowCount获取输入字段中的行,但是图像失败

您无法设置文件输入值。要检查图像值,只需echo $image;在页面上的某个位置即可。

本文链接:https://www.f2er.com/3154182.html

大家都在问