Question

CakeDC Users plugin includes a table called user_details. At first I thought it was just like the table wp_postmeta (WordPress) to hold extra info about the users. But after checking the table, it has more fields than I would expect. Well, more than I would use if I had to create that table.

mysql> describe user_details;
+-----------+--------------+------+-----+---------+-------+
| Field     | Type         | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| id        | varchar(36)  | NO   | PRI | NULL    |       |
| user_id   | varchar(36)  | NO   |     | NULL    |       |
| position  | float        | NO   |     | 1       |       |
| field     | varchar(255) | NO   | MUL | NULL    |       |
| value     | text         | YES  |     | NULL    |       |
| input     | varchar(16)  | NO   |     | NULL    |       |
| data_type | varchar(16)  | NO   |     | NULL    |       |
| label     | varchar(128) | NO   |     | NULL    |       |
| created   | datetime     | YES  |     | NULL    |       |
| modified  | datetime     | YES  |     | NULL    |       |
+-----------+--------------+------+-----+---------+-------+

Can anyone give a light?

  • Can I use this table as a meta table with values that the user can not edit/add or should I create a separated table?
  • position, input, label, what are these fields?
Was it helpful?

Solution

You can use that table just don't display the fields in forms a user is allowed to edit and use the security component.

These values should be pretty self explaining:

  • Position says it all: Its the position/order of the fields.
  • Input, type of input, select, text, textarea...
  • label, simply the label to be displayed

But it is up to you if you use the fields or not to generate the input fields based on these values.

The table is thought to store any kind of user information in a dynamic way, in fact it is like wp_postmeta.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top