By Carly on Tuesday, 15 September 2015
Posted in General Issues
Replies 7
Likes 0
Views 642
Votes 0
Hi,

We are looking to write a report which will show a user and all the details they entered during registration. We looked in the database and found the table "social_fields_data" and that shows the details entered but how do we relate each of the rows to the fields they links too.
We have seen the tables "social_fields" but cannot see how the two tables can be joined.

See attached file for our data.

Any help would really be appreciated

Thanks
Carly
Hello Carly,

The idea of both table social_fields and social_fields_data is that the social_fields store the information for each field. For example, Address field. let say the ID for Address field is 134. This ID will be later used in social_fields_data table. Then, we go to the next table: social_fields_data. This table is used to store the data for each user's field. The field_id column is where the ID of the field is stored. Example here is the ID of the Address field: 134. The uid column is the user ID and the data column is the data for that field and for that particular user ID.

Hope this explanation helps.
·
Tuesday, 15 September 2015 11:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik,

Thanks for the reply.
That's exactly what we needed.

A further question - the datakey in the social_fields_data table is sometimes blank but on other occasions have the data in - for example JOOMLA_FULLNAME have datakey = name / last / middle and first.

Is there a way to always have the datakey to contain the content type - ie MOBILE has a blank datakey.

Hope that makes sense.

Thanks
Carly
·
Tuesday, 15 September 2015 21:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Carly,

I am really sorry for the delay of this reply as it is actually a public day off for us here. The "datakey" column on the fields data table is just a friendly unique identifier for apps or APIs to be able to retrieve field specific values.

For instance, if there is 2 textbox fields with a different id, it is impossible to distinguish them. Hence, we introduced the field key property which users can define if they need to.
·
Wednesday, 16 September 2015 17:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Where would we define the field key property so we can always have the friendly version for each column.

Thanks
Carly
·
Wednesday, 16 September 2015 18:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Go to your profile type, click on the custom fields tab. Then, click on any custom fields that are on the form and there is a properties that would appear beside the field. Then, click on the advanced tab.
·
Wednesday, 16 September 2015 20:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

We have a value in the unique_key on the advanced tab but that doesn't appear in the social_fields_data under datakey.
As an example, when we look in that table for the FULLNAME values we have datakey's with values of name, last, first and middle.
But for "GENDER" the datakey value is blank. Is it possible have the word "gender" in there?

Thanks
Carly
·
Wednesday, 16 September 2015 20:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry my bad, that is actually the `unique_key` column for the #__social_fields table. The datakey column on the #__social_fields_data are being inserted by the app itself. There's no way to automate inserting this. This is an identifier if the field stores multiple rows of record on the data table.

If you want to lookup for gender, you should join with the #__social_fields table by their unique key of GENDER
·
Wednesday, 16 September 2015 20:28
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post