X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 74A2AD1CCCB for ; Mon, 15 Dec 2003 09:01:59 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 07809-08 for ; Mon, 15 Dec 2003 05:01:33 -0400 (AST) Received: from tiberius.peacock.de (tiberius.peacock.de [62.154.214.98]) by svr1.postgresql.org (Postfix) with ESMTP id 74219D1B467 for ; Mon, 15 Dec 2003 05:01:31 -0400 (AST) Received: from sabrina ([194.115.93.84] helo=wildenhain.de) by tiberius.peacock.de with esmtp (Exim 4.14) id 1AVoV1-00027z-K5; Mon, 15 Dec 2003 09:54:43 +0100 Message-ID: <3FDD789A.7060201@wildenhain.de> Date: Mon, 15 Dec 2003 10:02:18 +0100 From: Tino Wildenhain User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.5) Gecko/20031024 Debian/1.5-2 X-Accept-Language: de-de, de MIME-Version: 1.0 To: "scott.marlowe" Cc: Nathaniel Price , pgsql-php@postgresql.org Subject: Re: [GENERAL] Reordering results for a report References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/48 X-Sequence-Number: 2494 Hi Scott, scott.marlowe schrieb: [...] > > print "?orderby=".$flds[$i]."moreurlstuffhere???"; > > Then, if the orderby is set when you build your query, just append it: > > if (isset($orderby)){ > $query.= "order by ".$orderby" > } > > Add some directional control: > > if (isset($dir)){ > if ($dir=="down") $query.=" DESC"; > } > [...] This leads to a nice SQL-injection posibility. At least it has to made sure that no illegal data can be transported via $orderby Regards Tino