Jump to content
Sign in to follow this  
kelly236

countries or state errors?

Recommended Posts

Hi everyone I'm having a problem with several customers who are saying they can't change the state in their accounts or if they try it keeps defaulting to Alabama, where can I change the states in the database to fix this customers error and also I went in to the countries table in my database and noticed this

 

The following indexes appear to be equal and one of them should be removed: PRIMARY, countries_id

 

could that be causing the problem and if so which one do I remove? Please if anyone could help I would be greatly appreciative

 

Thank you,

 

Kelly

Share this post


Link to post
Share on other sites

As long as you have not added any new contributions or changed any customer edit files. Then it sounds like your counties database file is the problem. I'd just clear out the countries file using phpmyadmin with:

 

truncate table "countries"

 

Then copy from your last good backup the countries file insert statement into phpmyadmin. Hopefully that will clear up the problem. If your countries file is messed up then without a countries id you wouldn't be able to get the correct state from the zone file.

 

REMEMBER TO ALWAYS BACKUP YOUR DATABASE BEFORE YOU MAKE ANY CHANGES TO IT.

Share this post


Link to post
Share on other sites

Thank you for your response but if I remember correctly I think some time ago I did redo the countries, but my question was could I just remove one of these from the error's I am getting? I just don't know which one to remove the Primary has the countries_id set as it's field and key name countries_id also has countries_id for it's field, but which one can I remove?

 

Thanks for any help

 

Kelly

 

 

The following indexes appear to be equal and one of them should be removed: PRIMARY, countries_id

 

 

As long as you have not added any new contributions or changed any customer edit files. Then it sounds like your counties database file is the problem. I'd just clear out the countries file using phpmyadmin with:

 

truncate table "countries"

 

Then copy from your last good backup the countries file insert statement into phpmyadmin. Hopefully that will clear up the problem. If your countries file is messed up then without a countries id you wouldn't be able to get the correct state from the zone file.

 

REMEMBER TO ALWAYS BACKUP YOUR DATABASE BEFORE YOU MAKE ANY CHANGES TO IT.

Share this post


Link to post
Share on other sites

In both 2.2a and 2.3.1 Osc the primary is countries_id as it should be because most of the time the file is accessed by the id. And the countries_name is a secondary key. So unless you have made a change to your countries file it should look like this:

 

drop table if exists countries;
create table countries (
 countries_id int(11) not null auto_increment,
 countries_name varchar(255) not null ,
 countries_iso_code_2 char(2) not null ,
 countries_iso_code_3 char(3) not null ,
 address_format_id int(11) not null ,
 PRIMARY KEY (countries_id),
 KEY IDX_COUNTRIES_NAME (countries_name)
);

 

Above is 2.3.1 database. The only difference between this and 2.2a is countries_name is varchar(64).

 

 

Primary has the countries_id set as it's field and key name countries_id also has countries_id for it's field

 

I'm don't think you need countries_id as your key field as it is already set as primary. Above when you say "key name" are you talking about countries_name or "name"? This is a bit confusing.

I would still go with what I said above with the exception that I would not do a truncate but just run the "drop table if exists countries; create table countries ( etc" before restoring the countries file, this will in effect set your countries file keys and such to the original.

Again if you have some contribution that depends on some change to the countries file you will have trouble with that contribution.

This is pretty much my best suggestion as the information given is very limited.

 

REMEMBER TO ALWAYS BACKUP YOUR DATABASE BEFORE YOU MAKE ANY CHANGES TO IT.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×