FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


MySQL - phoneNo. input mask





vickriz
Good day to all. Id like to ask someone if this script in INPUT MASK part is it possible?

Code:
CREATE TABLE tblSuppliers (
   supplierId   int(4) UNSIGNED ZEROFILL AUTO_INCREMENT NOT NULL,
   phoneNumber   VARCHAR(12) INPUT MASK !\(999") "000\-0000;0;_,
   remark      VARCHAR(255),
   PRIMARY KEY   (supplierId),
)TYPE MyISAM;



I just want to obtain a phoneNo. same as in ACCESS, but I don't know how to do it in MySQL.

All advice will appreciated very much. Thanks in advance.
kv
I don't think it is possible in mysql. However, you can achieve the same functionality at UI level.
qscomputing
Bad idea. What if you have a user from the UK, where numbers are in the format 01234 567890? That won't fit into your input mask. So I recommend just having a plain old text field.
mariohs
I would say that it's easier for you if you separate the fields.
country code
area code
number
extension

The user interface becomes easier to manage and if you are doing this through html, it should look good in any browser, including the ones that do not support javascript and also in text browser, like lynx...
vickriz
mariohs wrote:
I would say that it's easier for you if you separate the fields.
country code
area code
number
extension

The user interface becomes easier to manage and if you are doing this through html, it should look good in any browser, including the ones that do not support javascript and also in text browser, like lynx...


Thanks the good recommendation mario..

Thats what I've thinking of but I have to look for a script that would auto generate the contactnumber once inputed; coming from that country_code, area_code & number.

Thanks again.
Fire Boar
Like, for example...

Code:

// <snippet>
if (!$result = mysql_query("SELECT * FROM telephone_directory"))
  die "Unable to process query";
while ($row = mysql_fetch_array($result))
{
  echo "Country Code: $row['countrycode']<br>\n";
  echo "Area Code: $row['areacode']<br>\n";
  echo "Number: $row['number']<br>\n";
  echo "Extension: $row['extension']<br><br>\n";
}


... that? You can use that and just change the stuff that's echoed. And change the query adding a "WHERE" to make it only do a certain person. Just use the $row[...] things where you want each part in the output.
vickriz
Big thanks for the script bro.

I'll going to use it for my needs.

Mabuhay[LongLive] Frihost!! Very Happy
mariohs
vickriz wrote:
Thanks the good recommendation mario..

Thats what I've thinking of but I have to look for a script that would auto generate the contactnumber once inputed; coming from that country_code, area_code & number.

Thanks again.

Is there any specific logic to generate the contact number or is it just sequential numbers? If the second, you can create a column in mysql with auto-increment.
Related topics
PHP Book (Php and Mysql for Dynamic Web Sites)
E-Cards with PHP & MySQL
Build an online dictionary by PHP/MySQL
Make search engine With PHP and mySQL, for your site
PHP Tutorial: Basic Shoutbox w/ MySQL
Help Installing MySQL on SuSE Linux using ssh
Inserting data to MYSQL with a PHP script
MySQL Masters Binary Logs & Replication?
How do I make a MySQL dB ?
quick mysql question
mySQL - Day, date, month, year, time Output/Input
[man]Azlo tu mismo ShoutBox en PHP y mysql
MySQL TIMESTAMP
mysql gives the wrong result [solved]
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.