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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Which table holds the values of custom fields?
Pages: [1]

Author Topic: Which table holds the values of custom fields?  (Read 932 times)

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Which table holds the values of custom fields?
February 08, 2013, 04:29:07 pm
We have just upgraded from 1.9 to 4.1.5.  I have been unable to locate the table that holds custom field values for an SQL query

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Which table holds the values of custom fields?
February 08, 2013, 05:31:42 pm
You may be looking for tables eg
civicrm_value_<name of field group>
or you might be looking for
civicrm_option_value

depending on whether you want to find the contacts data or the option values themselves
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Which table holds the values of custom fields?
February 08, 2013, 06:48:54 pm
I can find the table with the name of the field group but I do not understand where the values are. Would they be somewhere in the civicrm_option_value table?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Which table holds the values of custom fields?
February 08, 2013, 06:58:20 pm
in civicrm_custom_field you will see the field names, and there is a column for option_group_id

this is what you can use in civicrm_option_value to find the options for that field

does that help
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Which table holds the values of custom fields?
February 08, 2013, 08:53:12 pm
Thanks very much, Peter. I need to find or create an ER diagram some day for the guy that does most of our queries.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Which table holds the values of custom fields?

This forum was archived on 2017-11-26.