I would like to work out the percentage of editing/change that one person has done to one article, so I can send out donations accordingly.
How do I do开发者_如何学C this automatically? (preferably in PHP)
The editing history is stored in the revision
table. If you have the page-id you can get the percentage of user edits by page (just replace the 1 with the page-id):
SELECT
rev_user, rev_user_text,
count(*) as rev_user_count,
(SELECT count(*) FROM revision WHERE rev_page = 1) as rev_total_count,
100 * count(*)/(SELECT count(*) FROM revision WHERE rev_page = 1) as rev_percent
FROM revision
WHERE rev_page = 1
GROUP BY rev_user
精彩评论