By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,709 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,709 IT Pros & Developers. It's quick & easy.

Numbers in VARCHAR field in mySQL database problem

P: 7
I'm completely new to PHP (jumped ship this week 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(20) which contains phone numbers. Unfortunately, the numbers containing leading zeros (0018005555555) or the international calling sign "+" (eg +18005555555) appears briefly (for about a second) then disappears when viewed in a browser (IE7) - refreshing the screen gets the same results. Here's what I've worked out.

Mozilla Firefox works fine (ie displays fine).
IE7 produces the problem.
Numbers beginning with 0 are ok.
Numbers beginning with 00 or + are the problem.
The data is there in the table (no problems with mySQL).
There are not changes being made to the table at the time.
The table column width is big enough.
The field length is being enough.

Expand|Select|Wrap|Line Numbers
  1. <td width="160"><?php echo $row_rsMusic['Phone1']; ?></td> 
I'm wondering if it's PHP or javascript (which I know even less about, sadly).
Many thanks in advance.
Nov 2 '07 #1
Share this Question
Share on Google+
4 Replies


Atli
Expert 5K+
P: 5,058
Hi Vlinder. Welcome to TSDN!

That sounds weird.
Can you take a look at the source view in a browsers that is giving you this problem and check if the number in there is as it should be?

If it is, this might be a bug in the browsers rendering engine. (In IE's case that would not be a huge surprise.). You may want to try splitting it and displaying it in two (or more) separate pieces.

If it is not, it could be a problem with either your SQL queries or your PHP code (or JavaScript if that's somehow involved), in which case it will help if you posted the code here. (In [code] tags please).
Nov 2 '07 #2

P: 7
Had brain wave whilst chopping an onion (ahem): could it be the Skype add on?

Disabled the Skype add on in IE7 and the numbers are now displaying fine.

Now I just have to find a way of getting the Skype add on to recognize the international numbers. Any ideas?

Sorry for posting in the wrong forum though.
Nov 2 '07 #3

Atli
Expert 5K+
P: 5,058
I'm not familiar with the Skype add-on.

But if disabling it fixed the problem I would have to guess the add-on is either doing something really smart that we don't understand, or something really stupid that it's developers didn't design it for.
Nov 3 '07 #4

P: 7
For help with number formatting with Skype add-on go to:

http://skype.otherlinks.co.uk/page.a...ber_formatting
Nov 14 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.