For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > January 2005 > Hyphens and MySQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Hyphens and MySQL
Mark Benson

2005-01-28, 3:57 pm

I am having problems with entering data into MySQL from a PHP script. I am taking the data from an array generated by a CSV parsing routine. That in itself works great, however I have large number of data units with '-' characters in (hyphens) and it is c
ausing the SQL queries to dump out with an error in the syntax. I can't get around it by putting a slash in front of them (using 'addcslashes'), it will just not at all accept them.
Are they the 'wrong' type of slash? Is there an easy way to search and replace/remove characters in a string in PHP?

--
Mark Benson

http://homepage.mac.com/markbenson
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com