Leading zeros in phone numbers - dbQuote?

I’m completely new to PHP (jumped ship yesterday from MSAccess and ASP to MySql and PHP) and I’d appreciate some help with leading zeros in telephone numbers.

I’ve got a field with type VARCHAR which contains phone numbers. Unfortunately, the leading zeros or the international calling sign “+” (eg +18005555555) disappear when view in a browser.

Can dbQuote help? If so, what is the syntax? If not, can anyone suggest anything better/different?

A line from a table is as follows:

 <td width="160"><?php echo $row_rsMusic['Phone1']; ?></td>

Many thanks in advance.

should work.

how is the data in MySQL looking?
chould it be that the changes where happening wile inserting the data?

dbQuote didn’t work. Any number with leading zeros or the + sign appear briefly in the page in the browser then disappear from the page.

The data is ok in the MySQL database - no edits were being made at the time (the users can’t get there yet). With my limited knowledge of all things PHP it appears to be that somehow the content of the VARCHAR field is being treated as a number. Is that possible? How can I prevent it?

PHP shouldn’t treat it as number, but it may automativly convert it to a number e.g. when using mathamatical operators or intval.

could u show us the code that u r using?

It’s the Skype add on for IE7 that’s causing the problem. I disabled the add on and the problem disappeared.

As a work around I’ve added the string ‘tel:’ to the number in the the field. Skype add on (now re-enabled) doesn’t recognize it as a number so the text gets displayed as required.

Thanks for the help though.

Sponsor our Newsletter | Privacy Policy | Terms of Service