开发者

Possible to call PDO::fetchAll() more then once?

开发者 https://www.devze.com 2023-03-24 05:14 出处:网络
Ive been running some queries using PHP\'s PDO library. It seems that whe开发者_如何学运维n i use:

Ive been running some queries using PHP's PDO library. It seems that whe开发者_如何学运维n i use:

<?php
    $smtp->execute();
    $result = stmt->fecthArray();
?>

It unsets the array inside PDO. I know this because when i call that very same line again, it returns an empty array. Why does it do this? Is this normal behavior?


When building the resulting array, fetchAll() removes all the results from the result set. Instead of calling it again, re-use the array you retrieved in the first time.

0

精彩评论

暂无评论...
验证码 换一张
取 消