[KLUG Members] php and quotation marks

Richard Harding rick at ricksweb.info
Tue Sep 27 07:43:49 EDT 2005


On Mon, 2005-09-26 at 22:11 -0400, Lunitix wrote:
> I, not too long ago, asked a question about quotation marks (") with php 
> and mysql.  The response was to add htmlspecialchars to my code.  That 
> allows the quotation marks (") can now be used, but the flipside is that 
> single quotes (') now creates the errors that the double quotes did.
> 
> How can I get both the single and double quotes to work?

There is a specific function for mysql for this:
http://us2.php.net/manual/en/function.mysql-escape-string.php

Always do that to your mysql data and you should be ok. 

Rick



More information about the Members mailing list