Re: [GENERAL] Reordering results for a report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Scott,

scott.marlowe schrieb:
[...]

print "<url goes here...>?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



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux