From: Peter Brawley Date: November 19 2005 2:54pm Subject: Re: Mysql Finding the country name from country prefix List-Archive: http://lists.mysql.com/mysql/191887 Message-Id: <437F3CC1.1010808@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=======AVGMAIL-437F3CC13736=======" --=======AVGMAIL-437F3CC13736======= Content-Type: multipart/alternative; boundary=------------020003080401000209010900 --------------020003080401000209010900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit abhishek jain, >I need to find the country name from the country prefix so eg. i have >a mysql table with prefix and name as the coumns and with datas like : >1 USA >11 XYZ >44 UK >91 India >92 Pakistan >123 ZXF You mean 'Country Code', right? 'International prefix' usually means 'international dialing prefix' (eg http://kropla.com/dialcode.htm#IDD). Country codes can be 1-4 digits long, and some satellite services use multiple codes for some countries, so it's a much better idea to separate country phone codes into their own column. PB ----- abhishek jain wrote: > Hi Friends, > I have a ticky mysql problem. > I need to find the country name from the country prefix so eg. i have > a mysql table with prefix and name as the coumns and with datas like : > Prefix, Name > 1 USA > 11 XYZ > 44 UK > 91 India > 92 Pakistan > 123 ZXF > and i have a number like 911122334455 and i need t match that to india. > I cannt do that directly by this statement select name from > country_table where prefix='91'; for the simple reason as i do not > have the length or the no. of digits the prefix is beforehand. > Pl. help me out. > Quick help will be appreciated. > >------------------------------------------------------------------------ > >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 11/18/2005 > > --------------020003080401000209010900 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit abhishek jain,

>I need to find the country name from the country prefix so eg. i have
>a mysql table with prefix and name as the coumns and with datas like :
>1          USA
>11        XYZ
>44        UK
>91        India
>92        Pakistan
>123      ZXF

You mean 'Country Code', right? 'International prefix' usually means 'international dialing prefix' (eg http://kropla.com/dialcode.htm#IDD).

Country codes can be 1-4 digits long, and some satellite services use multiple codes for some countries, so it's a much better idea to separate country phone codes into their own column.

PB

-----

abhishek jain wrote:
Hi Friends,
I have a ticky mysql problem.
I need to find the country name from the country prefix so eg. i have a mysql table with prefix and name as the coumns and with datas like :
Prefix,  Name
1          USA
11        XYZ
44        UK
91        India
92        Pakistan
123      ZXF
and i have a number like 911122334455 and i need t match that to india.
I cannt do that directly by this statement select name from country_table where prefix='91'; for the simple reason as i do not have the length or the no. of digits the prefix is beforehand.
Pl. help me out.
Quick help will be appreciated.

No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 11/18/2005
--------------020003080401000209010900-- --=======AVGMAIL-437F3CC13736======= Content-Type: text/plain; x-avg=cert; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Description: "AVG certification" No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 11/18/2005 --=======AVGMAIL-437F3CC13736=======--