As I commented on the blog, he fell into the trap of needlessly looping over sets of data.
1) Loop over MySQL result set in GetArray
2) Loop over array of results to format them in GetVideos
3) assumed loop over results to eventually display them to the user.
All three steps could be accomplished at the same time by simply using iterators.