As of PHP version 5.3 PDO_MYSQL
driver has been repleaced in favour of PDO_MYSQLND
. It introduced support for multiple queries.
Though, I can't figure out how to get both result sets if more than one SELECT
query has been passed. Both queries have been executed, it can't be that the second one was just dumped.
$db->query("SELECT 1; SELECT 2;")->fetchAll(PDO::FETCH_ASSOC);
Returns:
array(1) {
[0]=>
array(1) {
[1]=>
string(1) "1"
}
}
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…