Difference between fetch and fetchAll in PDO

Solved
playboy-1990 Posted messages 593 Status Membre -  
 zzz -
Hello,
I would like to know the difference between fetch and fetchAll.
Thank you.

1 réponse

Mihawk Posted messages 4753 Status Contributeur 846
 
Hello,

If I remember correctly: fetch will only return the first response to your query in an array, while fetchAll will return all the responses.

In other words: fetch will create an array with just one row, while fetchAll will create an array containing as many rows as there are responses.

--
Until we try, we won't know.
27
playboy-1990 Posted messages 593 Status Membre 273
 
Okay
Thank you
0
zzz
 
thank you
0