For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > April 2006 > Re: [PHP-DB] Single quotes in INSERT statements?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Single quotes in INSERT statements?
dpgirago@mdanderson.org

2006-04-26, 6:58 pm


> Skip Evans wrote:
>
[color=darkred]
> No, neither mysql_escape_string or
> mysql_real_escape_string worked.
>
> Yes, I am using MySQL, should have said that, sorry.
>
> But anyway, even with both of these functions, the
> data in the string containing the single quote as
> in "Don't Look" is still being truncated at the
> single quote mark.
>
> Any other suggestions would be greatly appreciated.


> Skip


For the archives:

Subject of this thread is misleading since the problem was not one of an
INSERT failing but of HTML not displaying properly because of quotes or
other special characters in the text in the database. Just goes to show
that the best way to get the right answer is to analyze the problem
accurately and ask the right question.

David
Martin Alterisio

2006-04-26, 6:58 pm

2006/4/26, dpgirago@mdanderson.org <dpgirago@mdanderson.org>:
>
>
>
>
>
> For the archives:
>
> Subject of this thread is misleading since the problem was not one of an
> INSERT failing but of HTML not displaying properly because of quotes or
> other special characters in the text in the database. Just goes to show
> that the best way to get the right answer is to analyze the problem
> accurately and ask the right question.
>
> David



Well, 80% of solving a problem is finding out what the problem is. If you
ask them to solve that 80% on their own then asking for help is rather
pointless. Anyway I agree that the subject was misleading, but this was
caused by how he explained the problem, particularly on the assumption that
addslashes was not doing what it was supposed to do so. What I advise is to
avoid assumptions and just present the symptoms of the problem.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com