RE: how to handle inserting special characters into a mysql field

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

 



[snip]
I'm going to be inserting data from a PHP form into a mysql field.  The 
data could contain special characters like < > ' " \ /, etc.  How do I 
handle that?  just $data = addslashes(htmlspecialchars($data)); before 
the insert query?  because later on the data will be read back from the 
mysql db and I don't want it to contain a special character that would 
break the PHP script.
[/snip]

I would use http://us3.php.net/mysql_real_escape_string

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux