留笔纪念
$sql = 'SELECT * FROM `body` where `id`>:id'; $s=$dns->prepare($sql); $s->execute([id=>0]); $newresult =$s->fetch(PDO::FETCH_ASSOC); print_r($newresult); $result =$s->fetchAll(PDO::FETCH_ASSOC);
所以用while循环也是这个道理
while($newresult=$y->fetch(PDO::FETCH_ASSOC)){ print_r($newresult); }
是循环查询,并不是循环输出