What method is best to use country table in mysql, php? JSON, xml or mysql table?
-
i am using country table in mysql using php? which is the best method ? xml or JSON or mysql table JSON: eg json.php $country = array('1'=>'india','2'=>'us'); xml: <xml> <countries> <country id="1">india</country> <country id="2">us</country> </countries> MYSQL: country_id 1 2 country_name india us
-
Answer:
I would use a cached xml file, but that is strictly a matter of my own personal preference. All are equally valid. From a performance perspective I suspect that MySQL would probably be a little slower than the others. I'm not sure how JSON and xml compare as far as speed of loading, but they are close enough that I've never noticed a difference.
Jim Barrett at Quora Visit the source
Other answers
There are 34 new countries in the world since 1990, so the chance of the countries list being updated often is fairly low. With that in mind I would incline on having a JSON string cached somewhere on the server and decoded in the boot part of the application.
Robert Doroftei
Related Q & A:
- What are the best country's for a gap year?Best solution by gapyear.com
- What is the best studying method?Best solution by Yahoo! Answers
- What method of teaching do Montessori schools use?Best solution by Yahoo! Answers
- What is the best way to remember all of the elements on the periodic table?Best solution by ChaCha
- What is the best way to learn PHP?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.