This is expected behaviour. The fetchAll
method returns an array of results; but you haven't assigned it to a variable and so that line of code does nothing good for you.
However, if you were to do:
print_r($stmt->fetchAll());
Then you would have the result printed to screen; if you wanted to use the result afterwards, then you need to assign the returned value to a variable:
$result = $stmt->fetchAll();
print_r($result);
This assigns the result to a variable and then prints out the full set of results.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…