Announcement

Collapse
No announcement yet.

Change area codes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change area codes

    Well I have a business listings with circa 100 business's listed with a 505 area code. THe men in charge at state level thought it would be a great idea to change to 575 area code. I dont want to have to go on, select busines, edit business, save businesss over and over and over. Is there a script or sommet I can run on the database to change all 505 to 575 ?


    I am just a voluntary moderator here, I do not speak for eUKhost officially!

  • #2
    just use phpmyadmin and use sql.
    first do a select * from your_table where area_code = 505 (you may not have the area code stored in a seperate field so will have to use 'substring', 'like' or 'left' to extract the area code bit)

    check that you get all the results back you want and no others (esp important if your area code isn't a seperate field)

    then run the sql:
    update your_table set area_code = 575 where area_code = 505 (or whatever 'where' clause you used above)

    Hope this helps
    David Allen - www.serina.co.uk

    Comment


    • #3
      I did
      Code:
      update pds_list set phone = 575 where phone = 505
      and it returned
      Code:
       Affected rows: 0 (Query took 0.0014 sec)


      I am just a voluntary moderator here, I do not speak for eUKhost officially!

      Comment


      • #4
        thank it helps!
        I used it in similar way.
        I store npa nxx lookup tool and had same problem.
        I solved it like this:
        UPDATE `NPA` SET `npa` = '505' WHERE `npa` = '704';
        So i`ve update all my nanp database with single query, and all npa and nxx are fine now.

        Maybe it could be useful for somebody, I`m a new in MySQL and it helps.

        Comment

        Working...
        X