You are here: Re: Trouble escaping / Misc nightmare « PHP Programming Language « IT news, forums, messages
Re: Trouble escaping / Misc nightmare

Posted by Ian Rastall on 06/29/05 05:25

On 28 Jun 2005 19:01:02 -0800, yf110@vtn1.victoria.tc.ca (Malcolm
Dew-Jones) wrote:

> $value = "this', 'will mess things up";
>
> $sql1 = "insert into tbl values ('$value')"; # inserts 2 columns!
>
> $esc_value = mysql_escape_string($value);
>
> $sql2 = "insert into tbl values ('$esc_value')"; # this is correct

Hi Malcolm. From my palty understanding of PHP, :-), it seems as if
you're talking about inserting values into a database. The values I'm
worried about are already in there. I use phpMyAdmin to build my
database, and I can see when I browse the table in question that the
apostrophes aren't causing a problem.

The HTML/PHP prints out the string just fine on the web page
(apostrophe and all). This is a string which can be clicked on, at
which point the browser sends the text of the link back to the
database, asking for a record with that string. It doesn't find it,
because the apostrophe is messing things up somehow. I would guess
this is a query somewhere in my HTML/PHP document, perhaps:

$album=mysql_escape_string($_GET['album']);

or

$query_rsDaevid = "SELECT * FROM daevid ORDER BY $sort_order ASC";

Nothing seems to help, though, and this is probably a simple thing (to
someone else, at least). :-) Sorry if I'm taking up too much space on
the ng. Just developing a real headache over this.

Ian
--
Was it not a comedy, a strange and stupid
matter, this repetition, this running around
in a fateful circle? (Hermann Hesse)
http://www.bookstacks.org/

 

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

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