473,788 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Numbers in VARCHAR field in mySQL database problem

7 New Member
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
4 2749
Atli
5,058 Recognized Expert Expert
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
Vlinder
7 New Member
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
5,058 Recognized Expert Expert
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
Vlinder
7 New Member
For help with number formatting with Skype add-on go to:

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

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

Similar topics

7
19712
by: Berislav Lopac | last post by:
I was lately wandering what would be the advantage of using varchar instead of text column data type in a database (specificall MySQL, but this might also be the case for other databases)? I mean, both of them are variable length, both can be indexed, and text can hold a lot more data... I'm just looking for some other opinions on the subjects. Berislav
7
2938
by: James | last post by:
I am currently working on a PHP based website that needs to be able to draw from Oracle, MS SQL Server, MySQL and given time and demand other RDBMS. I took a lot of time and care creating a flexible and solid wrapper and am deep into coding. The only problem is a noticed VARCHAR fields being drawn from SQL Server 2000 are being truncated to 255 characters. I searched around php.net and found the following : Note to Win32 Users: Due...
8
6277
by: Randell D. | last post by:
Folks, I once read an article in Linux Format whereby a technical writer had made performance recommendations on a LAMP environment. One of the points raised was for small columns in a database, that one is perhaps better off to trade a small waste of space for a gain on performance - The recommendation said that when you use VARCHAR(3) that MySQL searches for disk space to take a record that will accept a variable length value up to...
1
2765
by: Boris Wilhelms | last post by:
Hello all, at first, sorry for my bad English, I’ll give my best  We have a strange problem reading Text- and VarChar-Fields. Our configuration: -Windows 2003 Server -MySQL Server 3.23.36 -MyODBC 3.51
3
23823
by: usenet | last post by:
I have inherited a table where date information was saved from PHP as a VARCHAR. (Sigh.) This means that the so-called date fields look like this : August 1, 2005, 9:09 am EDT October 13, 2004, 12:28 pm EDT This makes them essentially useless for sorting and logical evaluation. Understandbly, the MySQL date functions don't seem able to convert the field to a "real" date field. This yields a blank (or maybe null) "realdate" :
0
2404
by: sfh | last post by:
Greetings all, I have a question concerning primary key types. In the past, I have always created tables with a primary key as an "int" such as: CREATE TABLE color_id ( color_id int(10) unsigned NOT NULL auto_increment primary key, color varchar(45) default NULL ) TYPE=INNODB DEFAULT CHARSET=latin1;
1
4694
by: sfh | last post by:
Greetings all, (I had posted this in MS SQL on accident, my apologies :( ) I have a question concerning primary key types. In the past, I have always created tables with a primary key as an "int" such as: CREATE TABLE color_id ( color_id int(10) unsigned NOT NULL auto_increment primary key,
4
6323
by: tcfin | last post by:
Hi, i have a problem to make a transtype from field XX varchar(20), example : 19 200 340,56 to field YY integer, required : 19200340
0
27261
by: maheshmohta | last post by:
Background Often while remodeling legacy application, one of the important tasks for the architects is to have an optimum usage of storage capabilities of database. Most of the legacy applications are constrained by the technology available at the time of their development and hence aren’t optimum as per current scenario. One of such cases is the extensive usage of CHAR fields, which aren’t optimum solution for space storage now. This paper...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.