I think the answer is: it depends.
It depends on how many queries are made for each version of code, on how fast are the respective servers (if they arent on the same server), various implementations, that sort of thing.
I would prefer using PHP to work with my data, but then that's because I'm more familiar with PHP and so can optimize and manipulate my code better than I can optimize and manipulate my queries.