RE: Hyphens and MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sure, lots of way, regex replacement, str_replace, etc

but its strange that a hyphen is causing an error.

can you post some code?

Bastien

From: Mark Benson <markbenson@xxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject:  Hyphens and MySQL
Date: Fri, 28 Jan 2005 14:21:34 +0000

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 causing 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

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux