Hi all I have a sql query that needs to be feed to a php page ......host_table.hostname ilike '%omc%' order by...... but when i use urlencode or rawurlencode on it i get the following. ......host_table.hostname ilike \'%omc%\' order by.... ^ ^ on the next page. it needs to be encoded as it is part of an javascript operation. Why is it doing this and how does one get around it. Thanx duncan