CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Trying to find a database table of a custom field
Pages: [1]

Author Topic: Trying to find a database table of a custom field  (Read 467 times)

rhrueda

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: Drupal Pressflow 6.22
  • MySQL version: 5.5.22
  • PHP version: 5.3.10
Trying to find a database table of a custom field
February 04, 2014, 04:41:41 am
Hi!

I´ve a custom data called "Language settings", and one of the custom fields is a multiselect field type. If I edit this field, I see this info:

LabelValue
0English
1Italian

I have an SQL query to obtain the labels, but I can´t find the Values which is what I need... The info should be in a table somewhere but I can´t find it :s

Some light here?

Thanks!!!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Trying to find a database table of a custom field
February 04, 2014, 10:04:47 am
Custom field table naming pattern is civicrm_value_<custom_data_set_name_id>
Protect your investment in CiviCRM by  becoming a Member!

rhrueda

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: Drupal Pressflow 6.22
  • MySQL version: 5.5.22
  • PHP version: 5.3.10
Re: Trying to find a database table of a custom field
February 05, 2014, 04:01:10 am
Yes, I know, but in this case this table is giving me only the labels (0, 1, ... ), and I guess there should be somewhere a table with the pair label - value  :-\

Thanks for helping!

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Trying to find a database table of a custom field
February 05, 2014, 05:12:29 am
You already have the label-value pairs from  the Custom fields UI, and in your original post there are only two of these, so if this is a one-off requirement I would use CASE ... THEN (or similar) to give the actual values.

Otherwise:
  • In the correct civicrm_value_... table your field heading should be Language_settings_XX.
  • In the civicrm_custom_field table for id = XX  you will find option_group_id= YYY
  • Then find all rows with option_group_id= YYY in the civicrm_option_value table.

(There could be a simpler link that I have missed)
« Last Edit: February 05, 2014, 05:15:44 am by joanne »

rhrueda

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: Drupal Pressflow 6.22
  • MySQL version: 5.5.22
  • PHP version: 5.3.10
Re: Trying to find a database table of a custom field
February 05, 2014, 06:49:19 am
Perfect!!!! I´ve found it!!!! many thanks!!!  :) :) :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Trying to find a database table of a custom field

This forum was archived on 2017-11-26.