CUstom field query for data publication

  • Samuele Spinelli
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #103823 by Samuele Spinelli
CUstom field query for data publication was created by Samuele Spinelli
Hi,
after the event enrolment submission, I would need to publish a chart with the stats of different choices (it's the sum od donation for charity projects).
However, I do not find any custom field in the registrant table.
I have read the custom field are written in a different table but in this way...how can i link those data?

Thank you

Samuele

Please Log in or Create an account to join the conversation.

More
8 years 6 months ago #103826 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic CUstom field query for data publication
Hi Samuele

I would say that it is hard and there is no way to get these data using a single query. You will have to look at the code in administrator/components/com_eventbooking/model/registrants.php to see how we handle it

Basically, the first step needs to get the data from main #__eb_registrants table

Then the next step is calling another method getFieldsData to get custom fields data for these records

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Samuele Spinelli
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #103828 by Samuele Spinelli
Replied by Samuele Spinelli on topic CUstom field query for data publication
Hi Tuan,
thank you for your reply.

I have solved using some unused Core FIelds (Organization, Address2, Zip) and modifing Labels for my purpose.
In this way I have three fields in the same table and I can just make a qurey to call them (I hope it will not cause any problem, changin the Field Type!)

Best regards

Samuele

Please Log in or Create an account to join the conversation.

More
8 years 6 months ago #103829 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic CUstom field query for data publication
Yes, using core fields will be the easiest way (I thought you are having many custom fields)

Changing field type won't cause any problem, don't worry

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc