简体   繁体   English

MySQL-XML与表格

[英]MySQL - XML vs Table

I'm developing a timesheet for a client in PHP/MySQL. 我正在为PHP / MySQL中的客户端开发时间表。 The basic functions is as follows: 基本功能如下:

User logs in User clicks either a clock in or clock out button. 用户登录用户单击“时钟输入”或“时钟输出”按钮。 At the end of the pay period the user submits the timesheet which will send to the accounting department for payroll. 在付款期结束时,用户提交时间表,该时间表将发送到会计部门以进行工资核算。 The data will be deleted after submit and start a new pay period. 提交并开始新的付款期后,数据将被删除。

I don't need to query the data. 我不需要查询数据。 I just need to store in/out timestamps, hours worked and total hours per pay period. 我只需要存储进/出时间戳记,工作时间和每个支付期的总时间。

Now here's the question. 现在是问题。 Would it be more efficient to have my create user script create a table for each user or to simply store the in/out data in XML as a TEXT column in my main user table? 让我的创建用户脚本为每个用户创建一个表或者将输入/输出数据以XML的形式作为TEXT列存储在主用户表中会更有效吗?

The XML seems easier to manage but I'm trying to make an efficiency decision. XML似乎更易于管理,但我正在尝试做出效率决定。

just create two tables one for the users with unique username and in other table use username as FK and store data against each user 只需为具有unique username的用户创建两个表,在另一个表中将username用作FK并针对每个用户存储数据

tab1=> id, username, name
1,xyz,marsh
tab2=> username(FK), data
march, data
march, data
someOtherUser, data
anotherUser, data
so on ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM