To educate myself in PHP and mysql, I am making a browser based rpg game. This game will allow any number of users to register an account and, once registered, they can add, edit or delete champions into my database. The problem is that they should ofcourse only be able to edit and delete champions that they made themself.
Now since this is just a practise project, I don't forsee large quantities of data or any serious attempts to hack it, but all the same I'd like to do it right so I can use this experience if I ever do get to work on large serious projects.
Should I
a) Let a new database be created for each user?
b) Let a new set of tables be created for each user?
c) Put the data of all users together in the same 3-5 tables and track for each row which user created it?
I think that C is the cleanest solution with the least data consumption, but perhaps the one with the least security. Is this correct?
And how would you suggest I implement solution C? Is there a privalege that restricts a user from only editting / deleting rows that he/she created him/herself? Or should I include this restriction in the PHP level? Would having this restriction in the PHP level not create a security risk since someone might be able to connect to my database without my php scripts?
And should a new mysql user be made for each player? Or can they all share a user account and make the distinction between players with an ID field or something like that?