用户定义的字段PHP Mysql [英] User Defined Fields PHP Mysql

查看:77
本文介绍了用户定义的字段PHP Mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在构建一个小型crm应用程序.我需要每个用户都能够定义自己的自定义字段.我目前正在使用php和mysql构建此crm.

I am currently building a small crm application. I need each user to be able to define their own custom fields. I am currently building this crm using php and mysql.

示例:我有一个客户"表,其中包含标准字段:姓名,电话,地址,电子邮件等.但是我想允许用户(唯一会话)添加针对其业务定制的字段只有他(其他用户)无法访问的文件.然后,我希望这些自定义字段能够像表中的所有其他字段一样起作用(搜索,发送和接收数据的能力).我希望我可以在mysql和php中完成此操作,但可以接受任何被认为是最佳实践的技术或解决方案.谢谢您的帮助.

Example: I have a "customer" table which has the standard fields: name, phone, address, email, etc. But i want to allow the user (unique session) to add fields that are custom to his/her business which are only accessible to him (not other users). I then want these custom fields to function just like all the other fields in the table (ability to search, send and received data). I am hoping i can accomplish this in mysql and php but am open to any technology or solution that is considered best practice. Thank you for your help.

推荐答案

@Matt H:此方法被视为AEV还是仅是标准关系数据库?

@Matt H: Is this method considered AEV or just standard relational db?

因此,因为我将在许多dif行业中拥有许多用户,他们希望将自己的自定义字段添加到许多不同的表(联系人,交易,事件等)中,所以我假设我需要customfield表具有user_fk/id或公司fk/id,相关表fk/id,ID和字段名?我在正确的轨道上吗?然后,需要创建第二个表来保存每个自定义字段购买的数据,该表具有一个自定义字段fk/id,客户fk/id,id和一个用于保存实际数据的数据字段.这是正确的吗?

So because i will have many users in many dif industries that will want to add their own custom fields to a number of different tables (contacts, transactions, events, etc) i am assuming that i would need the customfield table to have a user_fk/id or company fk/id, a related table fk/id, an id, and a field name? Am i on the right track? Then in the need to create a 2nd table to hold the data for each custom field buy having a customfield fk/id, customer fk/id, id and a data field to hold the actual data. Is this correct?

好吧,一旦我建立了这两个额外的表,如何将它们添加到通讯录表中,以便用户看起来像一个大表,而不是3个表?

Ok so once i build those two additional tables how do I add them to the contacts table so it looks like one big table for the user, instead of the 3 tables?

再次感谢您的帮助.

答案

经过大量研究,我发现大多数希望完成此操作的人都在使用文档数据库而不是关系数据库.

after much research i have found that most people who wish to accomplish this are using document databases not relational databases.

这篇关于用户定义的字段PHP Mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆