Jump to content
Richard Jones

Tutorial for uploading a country list via PHPMyadmin (list inc)

Recommended Posts

Richard Jones

For some this will be basic knowledge for others it will be a revelation and for some well they probably never thought of it.  As this is a very supportive forum i wanted to share my recent experience and new skills to help others in the future.

 

I will not be going into detail on sql databases or the workings of Excel.  

 

Aim

The aim was to upload a country list to my site so users did not need to click to add.

 

Method

 

Stage 1

 

Back up your database

Create the field in jreviews in field manager in this case mine is jr_country

I added a country to the field

 

Stage 2

 


  • Load PHPMyadmin and select your Joomla database.
    Find  Table: jos_jreviews_fieldoptions
    Click --->Export
    Check CSV for MS Excel
    Check put field names in the first row
    Click ---> Go (bottom right corner)
    Save file to your computer

 

Stage 3

  • Open your spread sheet.
    Copy the countries to the field "text" and "value"
    See where your country is from stage 1.
    Assign the fieldid to the new countries (its the same number for all the countries) that's the same as the country you added from stage one (For me is was ID 6)
    Give the new countries an option ID (these are unique to each country)
    Give each country an order number.  For mine i ordered United Kingdom, and United States at the top but did the rest alphabetically.
    ignore the image option unless you want to add images
    Click ---> save

Stage 4

 

  • Go back to PHPMyadmin
    open Table: jos_jreviews_fieldoptions
    Click --->Import
    Click ---> Browse for file and then slect your CSV file
    Check CSV option
    Change Fields terminated by from a : to ,
    You can select any other options you need but for adding you can leave them as they are
    Click---> Go

 

You should have a message after a green tick saying it has been successful.  Your countries are now in your field on Jreviews.  Clear Cache and file reg (i always do this after messing with stuff like this) and go to your field in the Jreviews backend to see if they are displayed how you want them.  If not you can re order them manually or alter the CSV file and re upload.

 

Please check your field options for special character substitutions.

 

This method will work for any type of info you want to upload like states or cities etc.  I have read that Alejandro is working on a new feature to daisy link fields like select a country and that would bring up cities. (http://www.reviewsforjoomla.com/newsletters/jreviews_2.1.12-release.html) I am unsure how or if this would work with that.  I cant see why not though as its a single select list.

 

I hope this is of some Use.  I have also included the latest ISO 3166 country list in CSV format.  As of March 2010

countries.zip

Share this post


Link to post
derred

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
derred

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Alejandro

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Richard Jones

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
John Downy

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Hannah Nib

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Brill

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Edited by Brill

Share this post


Link to post

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Please refer to our Privacy Policy.