in reply to Re: Re: SQL query: are all results in one hashref key the same?
in thread SQL query: are all results in one hashref key the same?

Slightly off topic... but since you mentioned it: PLEASE don't actually put literal values into your sql by string interpolation: $sql = "... thing_id = $thing_id ...";. Do it with placeholders and bind values. This can be more and less of a performance issue with different types of databases, but it is always a security issue. In some databases, I could specify a $thing_id of "5; drop table thing", and you'd be hating life. On databases where that sort of thing can't be made to work (like oracle, for example), I could still plant a denial of service attack by saying that $thing_id was
"(select min(thing1.thing_id) from thing thing1, thing thing2, thing thing3, thing thing4, thing thing5, thing thing6, thing thing7, thing thing8, thing thing9, thing thing10 --look! no 'where', clause this is a 10-way cartesian product of thin +g! )"
You can come back in a month when your database finishes processing that query.

------------
:Wq
Not an editor command: Wq

Replies are listed 'Best First'.
Re: Re: Re: Re: SQL query: are all results in one hashref key the same?
by Cody Pendant (Prior) on Oct 12, 2003 at 04:40 UTC
    Thanks for reminding me. I didn't understand the second example, but I sure as hell understood the first. I will certainly make sure that stuff is sorted out before the site becomes public.


    ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print