【问题标题】:I am trying to fetch the rows in my input fields using rowCount but image is getting failed我正在尝试使用 rowCount 获取输入字段中的行,但图像失败
【发布时间】: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');
}

【问题讨论】:

标签: php html image


【解决方案1】:

您不能设置文件输入值。要检查图像值,只需 echo $image; 页面上的某处即可。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-09
    • 1970-01-01
    • 2022-09-27
    • 2021-04-22
    • 1970-01-01
    • 2017-03-19
    • 1970-01-01
    相关资源
    最近更新 更多