Do I need on site app or the myspace id?
Site app, most likely.
Can I use php/mysql for either on?
You can use PHP, either via an iframe (so the whole app canvas is your PHP pages, and you need to output the page), or
via makeRequest (you have the HTML and JavaScript on MySpace, and request data from your server via AJAX calls). In any case, profile boxes and homepage boxes
must be hosted on MySpace's servers, so you must use makeRequest for those.
Is it possible to store such stats on myspace?
You can via
newUpdatePersonAppDataRequest, but the storage space is limited (not sure of the limits exactly; MySpace don't make this clear). I'd say you should store data on your server via makeRequest. You'll have to check the oauth to make sure it's a valid request - I believe there's examples of that in the (rather messy) documentation, and on the forum here.
Good luck :)