HELLO i would like to ask that fetchAll() is good choice to retrieve all user message from database or i should use while loop?
I asked this question because i worry about internet traffic..
phoenix254
0
Junior Poster
Recommended Answers
Jump to PostIt's a matter of preference. However, regardless of what you use, you still have to loop through the result.
There is not much difference between while loop and foreach loop. There is an 8th of advantage if you don't loop inside the logic of your application. What requires the most …
Jump to PostU wrote too much. btw i ddint find anything about traffic
Perhaps you should read lorenzo's post again. The last line actually spells it out.
IMO, it makes little difference on small datasets, speed-wise, but you may encounter differences in memory usage.
fetchAll()
dumps the entire dataset into …
Jump to PostU wrote too much. btw i ddint find anything about traffic
You could also respect his time and say: "Thank you!"
All 12 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
lorenzoDAlipio
24
Junior Poster in Training
phoenix254
0
Junior Poster
diafol
phoenix254
commented:
Thank You very much
+2
Gideon_1
15
Junior Poster
gentlemedia
803
Master Poster
phoenix254
0
Junior Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
phoenix254
0
Junior Poster
Gideon_1
15
Junior Poster
phoenix254
0
Junior Poster
jkon
602
Posting Whiz in Training
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.