The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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?

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.

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