php pdo只返回一个结果集

I'm new to php. I am making a call to store procedure that returns multiple result sets in MYSQL.

I can't seem to get PHP PDO to get the second result set. I only get the first. Any help is appreaciated

--more info

store procedure just makes to select statements like so

select * from Product where productId = id;
select url from Images where product_id = id;

PHP Code:

 $conn = new PDO('mysql:host=localhost;dbname=salamancju_HardGraft', $this->userName, $this->password);

        $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);

        $stmt = $conn -> prepare('call GetProductById(:id)');
        $stmt->execute( array(':id' => $id));

        $results = array();

        do {
            $results = $results + $stmt->fetchAll(PDO::FETCH_NUM);

        } while ($stmt->nextRowset());

        echo json_encode($results);

Your problem has nothing to do with stored procedures. + operator on arrays works not the way you think. Use [] instead:

    do {
        $results[] = $stmt->fetchAll(PDO::FETCH_NUM);

    } while ($stmt->nextRowset());

will produce a nested array. If you want another format, please provide an example.

Save for this issue, your code is perfect. Most people who aren't new to PHP, won't be able to make it ever.