SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Storing Indic numerals in mySQL database

    Hi All,

    I'm trying to store Indic numbers in mySQL within a numeric column. However, when I submit it via my form (php), the stored value defaults to a zero (0). I can only seem to store them in a TEXT/VARCHAR column. My table, etc. is in utf-8.

    My questions:
    Is there are workaround for this? What have others done about this issue?

    Thanks in advance!

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    A symbol that happens to be a number in some language is no more a number to the database than the word "nine". Convert the text to an integer, then store it.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, Dan -

    Does this mean I run a convert function for my columns that use indic numbers?

    For example - SELECT convert('indic#' AS UNSIGNED INTEGER).

  4. #4
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Dan and everyone,

    I'm having a bit of trouble figuring this out.

    I'm attempting to change the column type for this - but not sure if this is correct, date=field:

    date convert(date AS UNSIGNED INTEGER)

    I am doing this in mysql while constructing the table, but can't get it to work. Am I on the right track?

    Thanks!

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Indic numerals are some kind of characters in an extended character set that represent numbers in a specific language, yes? MySQL doesn't know anything about all that, you need to do the conversion yourself

  6. #6
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see what you mean --
    Thanks, Dan


Bookmarks

Posting Permissions

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