Results 1 to 9 of 9
  1. #1
    Join Date
    May 2007
    Posts
    139

    Unanswered: an html table field "telephone" eg 46799999666, appear it 4.678E09

    when I appear data in webpage from mysql database table [phpmyadmin webbased] in an html table field "telephone" eg 46799999666, appear it 4.678E09 well how appear actual number plain and whole?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so how have you defined the column that is storing the telephone number
    my expectation is that you have stored it as a numeric type, rather than a text/character type
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2007
    Posts
    139
    mob varchar(25) utf8_general_ci Yes NULL
    fixed varchar(25) utf8_general_ci Yes NULL

    But I declared as above, any idea of error ? other records tests have letters in such fields ...?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if you do not need to find the total of all telephone numbers (hint: you don't) or the average telephone number (hint: you don't) then you don't need to use a numeric datatype
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by lse123 View Post
    But I declared as above, any idea of error ?
    phpmyadmin sucks

    there's your answer right there

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    OK so if the column is defined as varchar, then the problem is the variable data type you are using to store or manipulate the phone number in the front end
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    May 2007
    Posts
    139
    I used:
    $mob = mysql_result($result,$i,"mob");
    $fixed = mysql_result($result,$i,"fixed");
    .................................................. ...............
    <td><?=$mob; ?></td>
    <td><?=$fixed; ?></td>
    well, I did error where ? there are entries in phone numbers with letters, these appeare strings, normally just this record the problem ... 4.78E09

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    OK
    so where is the fault here
    is it in the data
    ...if so is that because of the way the data is stored (IE the way the column is defiend in the table)
    ...or is it in the way the data was set. what is the insert statement you used
    is it in the presentation layer

    you need to do some analysis of the problem to find where the fault lies

    to do that it may help to get a copy of the MySQL GUI tools, which includes Administrator and Query Browser.. use the Query Browser to find what the data actaully is inside the server.
    use Administrator to find what the coliumns actually are defined as

    if the telephone numbers appear correctly in the Query Browser then you presume the fault lies in your presentation layer, or how you get the data from the server.
    if the telephone number is incorrect then reither its wrongly defined in the server OR its in the presentation layer that set the value.

    just taking a wild guess, have you changed the column type from say a single or double precision number to varchar with data already in it?
    I'd rather be riding on the Tiger 800 or the Norton

  9. #9
    Join Date
    May 2007
    Posts
    139
    WELL MAY the table field prior be int converted to string... a new problem:
    When I have a text area and somebody types in without space when appeared data in html table the structure modified to fullfill the long word like typing
    "ffffffffffffffffffffffffffffffffffggggggggggggggg gggggggggggggggfffffffffffffffffffffffffffffgggggg ggggggggggggggggggggggggfffffffffff"
    well is any way from textarea text get cut in the middle so presentation of data appear normal ?
    Last edited by lse123; 12-14-09 at 04:42.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •