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) »
  • How to add Counties
Pages: [1]

Author Topic: How to add Counties  (Read 990 times)

ansm

  • Guest
How to add Counties
June 16, 2009, 12:36:42 pm
I drafted this for a manual, perhaps it can be useful to someone. (Tested with CiviCRM 2.2.5)

Adding Counties to CiviCRM
CiviCRM does not come with a list of counties, so we have to add them.  This process shows how to modify the civicrm database directly.
When using your local development environment, visit http://localhost/wamp.php which is your gateway to tools which came with the WAMP development software.  Click the PHPmyadmin link.  
 
When working with another development software or directly on the remote website, find the link to PHPmyadmin on your own.  The link for the Cpanel software of our webhoster is shown below:
 
When you are at the phpmyadmin screen, click the civicrm database in the upper left.  Now you get a list of tables, and we have to guess which one stores counties.  Luckily it’s obvious, we click on civicrm_county:
 
Next, we need to examine how the county information is stored.  Click browse to see the data:
 
ID is usually just a unique number, name is obvious, but we don’t know the state_province_id for our province.  So we look for a table named after state for a clue.  We find one called civicrm_state_province.  Upon browsing it, we see a field id (State / Province ID) which seems to be the number we are looking for.
Now click Search, type your province name, and the corresponding row will be listed.
We are now able to conclude that the ID for Nova Scotia is 1106.
To add a list of counties, go back to civicrm_county and click insert.  We will enter counties like this:
 
We used 7 for id because 1-6 already existed as samples in the database, however we’ll erase them later.
For now, we complete entry of Nova Scotia’s counties.  Enter each county and click go.  Then click insert and start again.
When done, you can delete the sample counties by using the browse screen, checking the 6 samples, and clicking the x or delete button (marked with an X).
We are now able to include contact->county into a Profile, and use it in a form.
« Last Edit: June 16, 2009, 12:42:28 pm by ansm »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to add Counties

This forum was archived on 2017-11-26.