Page 1 of 1

Select special characters

Posted: Wed Jul 28, 2010 11:45 am
by mazola
Hi All

I am selecting data from mysql database; below is the scenario;

I have a column with data like 'Products & Services'. I get a value on my page, i.e page title, which is 'Products & Services'.
I then pass this value to my query as 'select * from tbl where fieldname='Products & Services''. Since the actual data stored in the table is 'Products & Services', I do not get any results.

Please any help on this will be appreciated. I am using php to execute the query.
Thanks in advance.

Re: Select special characters

Posted: Wed Jul 28, 2010 11:49 am
by AbraCadaver

Code: Select all

htmlentities("Products & Services");