我是一个noob数据库/游戏开发者(实际上这将是我的第一个游戏)我一直对制作游戏感兴趣,所以我决定开始使用我最强的语言,即PHP.
我对数据库的工作非常有限(基本上是搜索引擎和一些统计信息收集),所以我不完全确定为我的游戏设置这样一个数据库的最佳方法.
我正在思考
table: users
user_id, int, 10, auto_increment, null, primary
username, text, 30, not null
password, text, 128, not null (i plan to use my own encryption methods but open to suggestions)
E-mail, text, 50, not null
last_login, text, 30, not null (this could probably be date, not sure how to handle it yet)
last_ip, text, 15, not null (tracking last logins for user)
Run Code Online (Sandbox Code Playgroud)
然后将会有另一张表格,其中包含他们帐户的游戏详情,我计划将被动收入流和区域所有权,甚至公会和玩家团体聚集在一起,并进一步沿着聊天室等,但这是一个不同的主题.还将有单位建设计时器和开放的球员市场.
现在我只是想要了解基础知识
table: game_data (i know horrible i'll think of a better name later)
user_id, …Run Code Online (Sandbox Code Playgroud)