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.
精彩评论