You can give the www or mysql user a quota,
but that will put a hard limit on the size of all databases.
Instead, you should probably make a small script that checks the size of the database files and warns when they are too big. You could change the script so that if the file gets too big, it will revoke the "insert/update" rights for that user.