SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Thread: # character

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Florence, Italy
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I have this strange thing happening in my MySQL database whenever a visitor registers his/her company and in any of the fields uses the "#" character like e.g. in an address Bla Bla Street #456.

    What happens is that when I back up the database with a dump file (using PHPMyAdmin) and the next time I use that backup file it will tell me that there was an error and only the rows up to that error are inserted. By trial & error I found out that the two suppliers I got this error with was because they used this character: by removing it from the back-up file I no longer had any problems re-creating the table.

    Is there any way I can avoid this problem? Something like htmlspecialchars?

    Another thing that happened once was that someone who registered used apostrophes in the text which normally isn't a problem, but this time in the database it got changed to something weird like "%&#". That's not exactly what it was but I can't remember now. And also that time the dump file didn't work because of the "#" character. Does this have to do with the character set their using?

    Willow

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's because the POUND sign is the indication of a comment tag in mySQL.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This problem is a real pain. After large research, I found that MySQL only looking for comments when you got more then one query seperated by ;

    Meaning if you can seperate them good enough and run it one-by-one you will have no problem. I have made script that does a bit better job then MySQLAdmin at seperating queries and running then one-by-one. Reply if you interested in it.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Florence, Italy
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by creole
    I think it's because the POUND sign is the indication of a comment tag in mySQL.
    Right. the Pound sign - couldn't think of its real name - wonder why it's called that way.

    In any event, just wondering if there isn't a SIMPLE way of escaping this character, like e.g. addslashes does with " "

    Willow

  5. #5
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No way of escaping it (at least I did not found one), only way is to run queries with it seperatly one by one.

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not actually called the Pound sign.

    I think it's called a Hash or an octohedral or something like that. In the states everyone just calls it the POUND sign though. Don't know why.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  7. #7
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's also a sharp sign.

  8. #8
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Florence, Italy
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And in Dutch and Italian it's called "hekje" and "cancelletto", respectively, which both translate into "gate".

    Go figure.

  9. #9
    SitePoint Zealot DarkMonkey's Avatar
    Join Date
    Apr 2001
    Location
    uk
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only true pound sign is £

    *sings british national anthem*
    Last edited by DarkMonkey; May 4, 2001 at 18:22.

  10. #10
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  11. #11
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dictionary.com:

    hash

    1. <character> "#", ASCII code 35.

    Common names: number sign; pound; pound sign; hash; sharp; crunch; hex; INTERCAL: mesh. Rare: grid; crosshatch; octothorpe; flash; ITU-T: square, pig-pen; tictactoe; scratchmark; thud; thump; splat.

    The pronunciation of "#" as "pound" is common in the US but a bad idea; Commonwealth Hackish has its own, rather more apposite use of "pound sign" (confusingly, on British keyboards the pound graphic happens to replace "#"; thus Britishers sometimes call "#" on a US-ASCII keyboard "pound", compounding the American error). The US usage derives from an old-fashioned commercial practice of using a "#" suffix to tag pound weights on bills of lading. The character is usually pronounced "hash" outside the US

    2. <programming> hash coding.

    3. The preferred term for a Perl associative array.

    (1995-03-06)

  12. #12
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    octothorpe...

    that's the one I was trying to think of.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  13. #13
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


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
  •