A general question, without a specific case in mind - is it usually preferred to use MySQL stored procedures over writing a PHP script that performs the same calculations an
I've heard people say "let the database do as much as it can" and others cried like "wtf, what are you doing to my database performance".
So I guess it should mostly be a decision of usage rate (stored procedures will stress the MySQL process and PHP code will stress the web server process).