September 10th, 2004, 08:41 AM
Escaping HTML Strings Within MySQL
I am wondering if it is possible to escape HTML strings within MySQL. I want to select a list of criteria from a MySQL table and concatenate them together to form a HTML select menu. However, some of the category names have HTML special characters in them (like < > and &). I am wondering if there is an internal function in MySQL to escapte HTML characters or would it be necessary to write a stored procedure or something along those lines? (Unfortunately I don't have access to MySQL 5.0 so I can't use Stored Procedures).
Thanks for you time!
September 10th, 2004, 09:50 AM
use the replace function
select replace(replace(replace(categoryname,'&','&'),'<','<'),'>','>') as newname