You are here: Re: Escaping for PHP and MySQL « PHP Programming Language « IT news, forums, messages
Re: Escaping for PHP and MySQL

Posted by Gary L. Burnore on 08/09/07 22:30

On Thu, 09 Aug 2007 06:12:05 -0700, ZeldorBlat <zeldorblat@gmail.com>
wrote:

>On Aug 9, 6:42 am, Sanders Kaufman <bu...@kaufman.net> wrote:
>> I just found out that an app I wrote doesn't allow the user to input
>> apostrophes into the textarea. If they do, the insert/update fails.
>>
>> I'm sure this issue has been done to death - but it's the first time
>> it's come up for me.
>>
>> What I'm doing is something like this:
>>
>> function UpdateRecord($iID, $sContent) {
>> $sSQL = "UPDATE MyTable SET content='$sContent' where id=$iID";
>> $bSuccess = RunSQL($sSQL);
>> return $bSuccess;
>>
>> }
>>
>> Is there a simple escape command, or am I going to have to get all into
>> writing some complex handler for apostrophes and whatnot.
>
>Yes. But you haven't said which database you're using.

Wow, putting it in the subject line isn't enough?
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация