execute(array($id2)); $res1=$stmt->fetchall(PDO::FETCH">
输入banner图图片脚本导航/分类

我这个代码为什么打印不出来数据呢?

id也是有值的 数据库里面也有数据 也没有报错的地方为什么就是打印不出来数据呢?

prepare("select id,name,content from reply where reid=?");
   $stmt->execute(array($id2));
   $res1=$stmt->fetchall(PDO::FETCH_ASSOC);
    foreach($res1 as $v2){
      echo $v2['content'];
     }
   ?>

回复内容:

id也是有值的 数据库里面也有数据 也没有报错的地方为什么就是打印不出来数据呢?

prepare("select id,name,content from reply where reid=?");
   $stmt->execute(array($id2));
   $res1=$stmt->fetchall(PDO::FETCH_ASSOC);
    foreach($res1 as $v2){
      echo $v2['content'];
     }
   ?>

$stmt=$pdo->prepare("select id,name,content from reply where reid=?");

name字段不存在,改为reid